8000 Fix scalafix after ZLayer->ZServiceBuilder PR by swoogles · Pull Request #6041 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix scalafix after ZLayer->ZServiceBuilder PR #6041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

swoogles
Copy link
Contributor
@swoogles swoogles commented Nov 15, 2021

Corrections to some errant refactoring for ZServiceBuilder.
Also added some migrations around this type.

Created a ticket here to prevent this in the future:
#6040

@@ -1638,19 +1638,19 @@ object ZIOSpec extends DefaultRunnableSpec {
} yield assert(res._1)(equalTo(List(0, 2, 4, 6, 8))) && assert(res._2)(equalTo(List(1, 3, 5, 7, 9)))
}
),
suite("provideCustomServices")(
Copy link
Contributor Author
@swoogles swoogles Nov 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the general case, it would be a mistake to try and "fix" user variable/test names/etc, so it's more accurate for our in Specs to have an old name and keep the old name in the output.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

testM("provides the part of the environment that is not part of the `ZEnv`") {
val loggingServiceBuilder: ZServiceBuilder[Any, Nothing, Logging] = Logging.live
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our input files should still have the old types, since they compile with the old version of ZIO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have been a little aggressive in excising any references to ZLayer. 😅

@@ -162,7 +162,11 @@ class Zio2Upgrade extends SemanticRule("Zio2Upgrade") {

val ZIORenames = Renames(
List("zio.ZIO"),
Map("run" -> "exit")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has the only new migration logic added under this PR

@swoogles swoogles force-pushed the series/2.x_fix_scalafix branch from ba8a2dc to 131d3a7 Compare November 15, 2021 04:58
@adamgfraser adamgfraser merged commit 7471ccd into zio:series/2.x Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0