-
Notifications
You must be signed in to change notification settings - Fork 501
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
Test of the Scalafix migration for Cats 2.2.0 #1582
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…235bd7c92e431ab1902db174cf4665b05e08f2f1"
…2_0?sha=235bd7c92e431ab1902db174cf4665b05e08f2f1"" This reverts commit 83d84eb.
…bd7c92e431ab1902db174cf4665b05e08f2f1 again Some `cats.syntax.all._` imports are there now, but running scalafix now failed with a MissingSymbolException: [error] scalafix.internal.v1.FileException: unexpected error processing file /home/frank/data/code/scala-steward/core/modules/core/src/main/scala/org/scalasteward/core/edit/package.scala [error] Caused by: scalafix.v1.MissingSymbolException: Missing symbol local24 [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$2(LegacyCodePrinter.scala:79) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$2$adapted(LegacyCodePrinter.scala:71) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$mkString$1(LegacyCodePrinter.scala:46) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$mkString$1$adapted(LegacyCodePrinter.scala:40) [error] at scala.collection.immutable.List.foreach(List.scala:431) [error] at scalafix.internal.v0.LegacyCodePrinter.mkString(LegacyCodePrinter.scala:40) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$1(LegacyCodePrinter.scala:71) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$1$adapted(LegacyCodePrinter.scala:70) [error] at scala.collection.Iterator.foreach(Iterator.scala:943) [error] at scala.collection.Iterator.foreach$(Iterator.scala:943) [error] at scala.collection.AbstractIterator.foreach(Iterator.scala:1431) [error] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [error] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [error] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [error] at scalafix.internal.v0.LegacyCodePrinter.pprint(LegacyCodePrinter.scala:70) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$4(LegacyCodePrinter.scala:98) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$4$adapted(LegacyCodePrinter.scala:98) [error] at scala.collection.Iterator.foreach(Iterator.scala:943) [error] at scala.collection.Iterator.foreach$(Iterator.scala:943) [error] at scala.collection.AbstractIterator.foreach(Iterator.scala:1431) [error] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [error] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [error] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [error] at scalafix.internal.v0.LegacyCodePrinter.pprint(LegacyCodePrinter.scala:98) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$9(LegacyCodePrinter.scala:129) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$pprint$9$adapted(LegacyCodePrinter.scala:129) [error] at scala.Option.foreach(Option.scala:407) [error] at scalafix.internal.v0.LegacyCodePrinter.pprint(LegacyCodePrinter.scala:129) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$loop$4(LegacyCodePrinter.scala:201) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$loop$4$adapted(LegacyCodePrinter.scala:201) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$mkString$1(LegacyCodePrinter.scala:46) [error] at scalafix.internal.v0.LegacyCodePrinter.$anonfun$mkString$1$adapted(LegacyCodePrinter.scala:40) [error] at scala.collection.Iterator.foreach(Iterator.scala:943) [error] at scala.collection.Iterator.foreach$(Iterator.scala:943) [error] at scala.collection.AbstractIterator.foreach(Iterator.scala:1431) [error] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [error] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [error] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [error] at scalafix.internal.v0.LegacyCodePrinter.mkString(LegacyCodePrinter.scala:40) [error] at scalafix.internal.v0.LegacyCodePrinter.loop(LegacyCodePrinter.scala:201) [error] at scalafix.internal.v0.LegacyCodePrinter.convertSynthetic(LegacyCodePrinter.scala:206) [error] at scalafix.internal.v0.LegacySemanticdbIndex$.syntheticToLegacy(LegacySemanticdbIndex.scala:169) [error] at scalafix.internal.v0.LegacySemanticdbIndex.$anonfun$synthetics$1(LegacySemanticdbIndex.scala:51) [error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:285) [error] at scala.collection.Iterator.foreach(Iterator.scala:943) [error] at scala.collection.Iterator.foreach$(Iterator.scala:943) [error] at scala.collection.AbstractIterator.foreach(Iterator.scala:1431) [error] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [error] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [error] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [error] at scala.collection.TraversableLike.map(TraversableLike.scala:285) [error] at scala.collection.TraversableLike.map$(TraversableLike.scala:278) [error] at scala.collection.AbstractTraversable.map(Traversable.scala:108) [error] at scalafix.internal.v0.LegacySemanticdbIndex.synthetics(LegacySemanticdbIndex.scala:50) [error] at fix.v2_2_0.RemoveInstanceImports$$anonfun$fix$1.applyOrElse(/tmp/scalafix595746135189370008/Cats_v2_2_0.scala8000476978071258990.scala:27) [error] at fix.v2_2_0.RemoveInstanceImports$$anonfun$fix$1.applyOrElse(/tmp/scalafix595746135189370008/Cats_v2_2_0.scala8000476978071258990.scala:14) [error] at scala.PartialFunction$Lifted.apply(PartialFunction.scala:228) [error] at scala.PartialFunction$Lifted.apply(PartialFunction.scala:224) [error] at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$3$.apply(Api.scala:32) [error] at scala.meta.transversers.SimpleTraverser.$anonfun$apply$1(SimpleTraverser.scala:5) [error] at scala.meta.transversers.SimpleTraverser.$anonfun$apply$1$adapted(SimpleTraverser.scala:5) [error] at scala.collection.immutable.List.foreach(List.scala:431) [error] at scala.meta.transversers.SimpleTraverser.apply(SimpleTraverser.scala:5) [error] at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$3$.apply(Api.scala:33) [error] at scala.meta.transversers.SimpleTraverser.$anonfun$apply$1(SimpleTraverser.scala:5) [error] at scala.meta.transversers.SimpleTraverser.$anonfun$apply$1$adapted(SimpleTraverser.scala:5) [error] at scala.collection.immutable.List.foreach(List.scala:431) [error] at scala.meta.transversers.SimpleTraverser.apply(SimpleTraverser.scala:5) [error] at scala.meta.transversers.Api$XtensionCollectionLikeUI$traverser$3$.apply(Api.scala:33) [error] at scala.meta.transversers.Api$XtensionCollectionLikeUI.collect(Api.scala:36) [error] at fix.v2_2_0.RemoveInstanceImports.fix(/tmp/scalafix595746135189370008/Cats_v2_2_0.scala8000476978071258990.scala:14) [error] at scalafix.internal.v0.LegacySemanticRule.fix(LegacySemanticRule.scala:29) [error] at scalafix.internal.v1.Rules.$anonfun$semanticPatch$1(Rules.scala:75) [error] at scala.collection.immutable.List.map(List.scala:293) [error] at scalafix.internal.v1.Rules.semanticPatch(Rules.scala:73) [error] at scalafix.internal.v1.MainOps$.unsafeHandleFile(MainOps.scala:232) [error] (core / Compile / scalafix) scalafix.sbt.ScalafixFailed: UnexpectedError
…?sha=235bd7c92e431ab1902db174cf4665b05e08f2f1 again" This reverts commit 3393373.
…d00a2e83821515524d
…9a8bdb18d00a2e83821515524d" This reverts commit 6391581.
…205e58617e907566cd
…76d374be205e58617e907566cd" This reverts commit efe2073.
…de4b712136df9e48fb
``` [error] /home/travis/build/scala-steward-org/scala-steward/modules/core/src/test/scala/org/scalasteward/core/github/http4s/authenticationTest.scala:13:22: ambiguous implicit values: [error] both method catsMonadErrorForEither in object Invariant of type [A]cats.MonadError[[β$1$]scala.util.Either[A,β$1$],A] [error] and method catsInstancesForOption in object Invariant of type cats.MonadError[Option,Unit] with cats.Alternative[Option] with cats.CoflatMap[Option] with cats.CommutativeMonad[Option] [error] match expected type cats.Applicative[F] [error] .addCredentials(AuthenticatedUser("user", "pass")) [error] ^ ```
…63ade4b712136df9e48fb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a test of the Scalafix migration for Cats 2.2.0 (typelevel/cats#3566). Before this change, Cats was a transitive dependency of other dependencies so I added cats-core as dependency explicitly. I then added a
scalafix-conf.sbt
which contains thescalacOptions += "-P:semanticdb:synthetics:on"
(as per https://github.com/typelevel/cats/pull/3566/files#diff-c131653cee48b25eb56e8856605a9370). Then I ranscalafixEnable
andscalafix github:cb372/cats/Cats_v2_2_0?sha=235bd7c92e431ab1902db174cf4665b05e08f2f1
in a sbt shell.All
cats.implicits._
imports are gone but unfortunately the build failed with more than 200 errors. The first three errors are:It seems that adding
import cats.syntax.all._
to that file fixes these errors. I've no idea why the migration didn't add them automatically.