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
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ scala:
- 2.13
script: sbt test

stages:
- name: test
- name: release
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork

jobs:
include:
- stage: release
script: sbt ci-release

notifications:
email:
on_success: never
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ Scalafix will support 2.13 and 2.11 with cross-building ExplicitNonNullaryApply

# Scalafix Rewrites for Scala

## To develop the rule
## To develop a rewrite

```
sbt ~tests/test
# edit rewrites/src/main/scala/fix/Scala213.scala
# edit rewrites/src/main/scala/...
```

## To run the rule
## To run the rewrites

0. Publish the rule: `publishLocal`
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 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`
1. [Install Scalafix](https://scalacenter.github.io/scalafix/docs/users/installation.html)
2. Enable synthetics in SemanticDB; e.g. `semanticdbOptions += "-P:semanticdb:synthetics:on"` in sbt 1.3+
3. Run the [external rule](https://scalacenter.github.io/scalafix/docs/rules/external-rules.html), e.g.:
* `scalafix dependency:ExplicitNonNullaryApply@org.scala-lang:scala-rewrites:VERSION`
* `Test/scalafix dependency:ExplicitNonNullaryApply@org.scala-lang:scala-rewrites:VERSION`
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.17")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.17")