mlachkar on gh-pages
Deploy website Deploy website … (compare)
mlachkar on gh-pages
Deploy website Deploy website … (compare)
mlachkar on main
Update scalameta, semanticdb-sc… (compare)
mlachkar on main
Update scalafmt-core to 3.5.4 (… (compare)
mlachkar on gh-pages
Deploy website Deploy website … (compare)
mlachkar on main
I want to add my rules to commu… (compare)
Although it's unfortunate so much investment is needed to work around this bincompat issue
macros make harder a problem already hard enough :)
scalafix.v1.*
(or something like that) with the scalafix-cli classloader. But after looking at the code, I realized some scalameta/metaconfig types are exposed through scalafix.v1.*
, so that lack of clear boundaries makes it impossible to get both sandboxing AND class unicity across classloaders.
.sbt
files? I wanted to apply https://github.com/liancheng/scalafix-organize-imports on these files as well.
Thanks @olafurpg , I understand that it might be a bit of a strange thing to want to do. A simplified example of what I'm trying to do is something similar to this-
trait Level {
def level = 1
}
class Example extends Level
Rewrite as-
class Example {
def level = 1
}
To do this, I would need to have access to the AST for Level
and Level
could be defined in another file. If Level
was defined in a dependency, all bets are off and I would not be able to get the AST.
Rule.afterComplete()
https://github.com/scalacenter/scalafix/blob/1c0ba35cc71f28551f98ea607d47f4db7147d802/scalafix-core/src/main/scala/scalafix/v1/Rule.scala#L46
ExplicitResultTypes
has logic like that but you can look at the implementation to see that it's not that trivial to do correctly
OrganizeImports
external 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.DBIOAction
s, but only the last one is returned, others are ignored. This fix wraps them with DBIO.seq
.@/all
We are happy to announce the release of Scalafix 0.9.30
. Huge thanks to @taisukeoe and @adpi2 for their great contributions (release notes: 1 and , 2).
RemoveUnused
rule that allows removing unused function parameters (scalacenter/scalafix#1444, scalacenter/scalafix#1448)scalafix-interfaces
dependency 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.overriddenSymbols
(thanks @tanishiking)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())
input:
Observable(1,2,4)
.flatMap(3, x => Observable.from(x))
.flatMap(3, x => Observable.from(x))
expected output:
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.