This room is no longer active, please join the rest of the scalameta community on https://discord.gg/8AHaqGx3Qj
mlachkar on gh-pages
Deploy website Deploy website … (compare)
mlachkar on gh-pages
Deploy website Deploy website … (compare)
bjaglin on main
remote gitter shield Merge pull request #1655 from s… (compare)
bjaglin on main
Update scalafmt-core to 3.5.9 Merge pull request #1656 from s… (compare)
scalafix.sbt.InvalidArgument: scalafix.v1.Rule: Provider fix.MyFix could not be instantiated
. Is this to do with sbt being scala 2.12 only?
Hello everyone, I'm using a custom dependency loaded on some custom resolvers. When I add them as
ThisBuild / scalafixDependencies += "com.foo.bar" %% "scalafix-foo" % "1.0.0"
ThisBuild / scalafixResolvers ++= ...
lazy val myProject = project
.settings(
// ...
)
everything works fine. If I inspect my build with consoleProject
I can see my scalafixDependencies
and scalafixResolvers
in ThisBuild
and in myProject
.
However if I move the scalafix settings in the project like so:
lazy val myProject = project
.settings(
// ...
scalafixDependencies += "com.foo.bar" %% "scalafix-foo" % "1.0.0",
scalafixResolvers ++= ...
)
scalafixAll
gives me a [error] (scalafixAll) scalafix.sbt.InvalidArgument: Unknown rule 'MyRule'
. If I inspect my build with consoleProject
I can see my scalafixDependencies
and scalafixResolvers
in myProject
but not in ThisBuild
.
Can anyone help? I need to move the settings inside the project as in my company we're using using a custom sbt plugin that creates project with standard settings.
overriddenSymbols
(scalacenter/scalafix#1476). Thanks @tanishiking & @SethTisue for the contributions!
Hi all, I've got a rule defined that has been successfully applied to multiple projects already, but there are some projects that throw this error when I execute it:
[error] [E0] /tmp/scalafix2610516103563897436/Zio2Upgrade.scala3899217760876070558.scala:450:13 error: wrong number of type parameters for method map: [B, That](f: scalafix.v1.SymbolMatcher => B)(implicit bf: scala.collection.generic.CanBuildFrom[List[scalafix.v1.SymbolMatcher],B,That])That
[error] }.map[PartialFunction[Tree, Patch]](symbolMatcher => { case t @ ImporteeNameOrRename(symbolMatcher(tree)) =>
The rule is here: https://github.com/zio/zio/blob/series/2.x/scalafix/rules/src/main/scala/fix/Zio2Upgrade.scala
The project we're applying it to is here: https://github.com/zio/zio-akka-cluster
scalafix.interfaces.Scalafix
(latest) it's not clear what is required to uptake that. I would appreciate if you could provide some pointers on how we could provide equivalent functionality as the plugin for sbt (if any), or maybe just let us know if this is still very early days and we should hold that off for now.
scalafix Collection213Upgrade
the HelloWorld.scala
file doesn't get rewritten with any fixes?? I can't figure out what is wrong. Any help appreciated..
Term.NewAnonymous(tmpl)
when need to turn that tmpl
into a class
Okay figured it out, you can delete the new by accessing the tokens of the Term.NewAnonymous
directly and removing the first one, ie. the solution here is:
val newAnon = ... // bound to the Term.NewAnonymous via matching
Patch.removeTokens(newAnon.tokens.head) +
Patch.addLeft(newAnon, "new Impl\n class Impl extends")
I gotta say, much happier with this than the sed script I was contemplating :)
Patch
but the implementations are all internal and there isn’t much that can be done with Patch
directly.
Hi,
Kinda late to the 2.13 party
I'm getting the following error when running scalafix dependency:RoughlyMapValues@org.scala-lang.modules:scala-collection-compat:2.6.0
in order to fix the mapValues MapView errors:[error] (Compile / scalafix) scalafix.sbt.InvalidArgument: Unknown rule 'RoughlyMapValues'
I've added ThisBuild / scalafixDependencies += "org.scala-lang.modules" %% "scala-collection-migrations" % "2.6.0"
to build.sbt
I've also added addCompilerPlugin(scalafixSemanticdb),
scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on"),
Is this error expected? what am I missing?
scalafix dependency:RoughlyMapValues@org.scala-lang.modules:scala-collection-migrations:2.6.0
[error] (Compile / scalafix) scalafix.sbt.InvalidArgument: Unknown rule 'RoughlyMapValues'
scalafix RoughlyMapValues
[error] (Compile / scalafix) scalafix.sbt.InvalidArgument: Unknown rule 'RoughlyMapValues'
scalafix Collection213Upgrade
[info] compiling 69 Scala sources...