Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CAUTIONS!
Current released Scalafix supports ExplicitNonNullaryApply [ONLY in Scala 2.12](https://github.com/scala/scala-rewrites/issues/31).
Scalafix will support 2.13 and 2.11 with cross-building ExplicitNonNullaryApply rule against them.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As someone who doesn't quite understand the mechanics of these libraries properly, allow me to attempt to clarify.

"Scalafix v1 will allow the ExplicitNonNullaryApply rule to work and fix up code in Scala 2.11 and 2.13"

Is that correct?

Copy link
Contributor Author

@taisukeoe taisukeoe Jun 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarification.

Is that correct?

It looks good to me except Scalafix version, depending on Scalafix release plans.

I'm not sure it will be effective only after Scalafix v1, since the PullRequest has been already merged and there might be additional v0.9.X releases.

So I'm fine with rewriting the sentence with:

"Scalafix will allow the ExplicitNonNullaryApply rule to work and fix up code in Scala 2.13"

(Considering the nature of the rule, 2.11 can be omitted)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of note, even coming Scalafix releases, ExplicitNonNullaryApply rule has to be cross-built by #31 PR.

Copy link
Contributor

@bjaglin bjaglin Jul 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although it won't be automatic, the upcoming 0.9.18 release of sbt-scalafix (probably out tomorrow) will support running rules compiled in 2.11 and 2.13, see scalacenter/scalafix#1166 for needed steps (feedback welcome there too!)


# Scalafix Rewrites for Scala

## To develop the rule
Expand All @@ -10,8 +14,9 @@ sbt ~tests/test
## To run the rule

0. Publish the rule: `publishLocal`
1. Add sbt-scalafix: `addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.5")`
1. Add sbt-scalafix: `addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.17")`
2. Add SemanticDB: `addCompilerPlugin(scalafixSemanticdb)`
3. Configure Semantic DB: `scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on")`
4. Run the rule: `scalafix dependency:Scala213@org.scala-lang:scala-rewrites:0.1.0-SNAPSHOT`
5. Run the rule on test sources: `Test/scalafix dependency:Scala213@org.scala-lang:scala-rewrites:0.1.0-SNAPSHOT`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scala213 rule has been renamed and no longer exists.

4. Run a rule you want: `scalafix dependency:RULE_NAME@org.scala-lang:scala-rewrites:0.1.0-SNAPSHOT`
- For example, you can run Varargs rule by: `scalafix dependency:fix.scala213.Varargs@org.scala-lang:scala-rewrites:0.1.0-SNAPSHOT`
5. Run the rule on test sources: `Test/scalafix dependency:RULE_NAME@org.scala-lang:scala-rewrites:0.1.0-SNAPSHOT`
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.15")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.17")