ExplicitResultTypeshas logic like that but you can look at the implementation to see that it's not that trivial to do correctly
OrganizeImportsexternal rule? i got scalafix the same way we do with scalafmt (via coursier standalone bootstrap). ideally, the external jar is also downloaded in advance as build servers are behind firewall and might not be able to.
error: The ExplicitResultTypes rule needs to run with the same Scala binary version as the one used to compile target sources (2.13). To fix this problem, either remove ExplicitResultTypes from .scalafix.conf or make sure the scalafixScalaBinaryVersion setting key matches 2.13., But I'm using scala 2.13.4. I tried to upgrade to 2.13.6, even downgrade to 2.13.0, but it still not working.
DBIOActions, but only the last one is returned, others are ignored. This fix wraps them with
RemoveUnusedrule that allows removing unused function parameters (scalacenter/scalafix#1444, scalacenter/scalafix#1448)
scalafix-interfacesdependency as described in the documentation.
-Xmaxwarns, which limits the number of fixes applied during each run, and the user had to configure this scalacOption to catch more warnings. Starting this release, this configuration is not necessary anymore. The rule will fix all the warnings, even if there are not printed by the compiler.
I'm trying to replace a method which changes form 1 bracket to 2 bracketed method.
So i expted that i could do, but this will result in code that will rewrite the full chain again.
val t : Term.Apply //these are the flatmap applies gotten in a collect Patch.replaceTree(t, Term.Apply(t.copy(fun.copy(name = Term.Name("mapParallelUnordered")), List(args.head)), List(args.last)).toString())
Observable(1,2,4) .flatMap(3, x => Observable.from(x)) .flatMap(3, x => Observable.from(x))
Observable(1,2,4) .mapParallelUnordered(3)(x => Observable.from(x)) .mapParallelUnordered(3)(x => Observable.from(x))
If i would only like to do the rename this works:
val t : Term.Apply Patch.replaceTree(fun.name, "mapParallelUnordered")
But a seemingly equivalent patch gives will also give repeat the full chain on each replacement:
val t : Term.Apply Patch.replaceTree(t, t.copy(fun.copy(name = "mapParallelUnordered").toString)
so how do i rename one function to a different one which has 2 apply lists instead of 1.
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
ThisBuild and in
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
myProject but not in
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!