Skip to content

Commit

Permalink
Use ExplicitImplicitTypes.symbolReplacements instead of ExplicitResul…
Browse files Browse the repository at this point in the history
…tTypes.symbolReplacements
  • Loading branch information
giabao committed Jun 24, 2020
1 parent 5198283 commit c3b2bc0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,13 @@ ExplicitResultTypes {
=> Add type to implicit members of `class`es, `trait`s

2. And this rule
```diff
```hocon
rules = [
ExplicitResultTypes
+ "github:ohze/scalafix-rules/ExplicitImplicitTypes"
"github:ohze/scalafix-rules/ExplicitImplicitTypes"
]
ExplicitResultTypes {
memberVisibility = [] # only rewrite implicit members
skipSimpleDefinitions = []
+ # maybe need
+ symbolReplacements {
+ "scala/concurrent/ExecutionContextExecutor#" = "scala/concurrent/ExecutionContext#"
+ }
# maybe need
ExplicitImplicitTypes.symbolReplacements {
"scala/concurrent/ExecutionContextExecutor#" = "scala/concurrent/ExecutionContext#"
}
```
=> Add type to implicit local `def/val/var`s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
rule = ExplicitImplicitTypes
ExplicitResultTypes.symbolReplacements {
ExplicitImplicitTypes.symbolReplacements {
"scala/concurrent/ExecutionContextExecutor#" = "scala/concurrent/ExecutionContext#"
}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ExplicitImplicitTypes(global: LazyValue[ScalafixGlobal]) extends Sem

override def withConfiguration(config: Configuration) = {
val symbolReplacements =
config.conf.dynamic.ExplicitResultTypes.symbolReplacements
config.conf.dynamic.ExplicitImplicitTypes.symbolReplacements
.as[Map[String, String]]
.getOrElse(Map.empty)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ExplicitImplicitTypesImpl(global: LazyValue[ScalafixGlobal]) extends

override def withConfiguration(config: Configuration) = {
val symbolReplacements =
config.conf.dynamic.ExplicitResultTypes.symbolReplacements
config.conf.dynamic.ExplicitImplicitTypes.symbolReplacements
.as[Map[String, String]]
.getOrElse(Map.empty)

Expand Down

0 comments on commit c3b2bc0

Please sign in to comment.