From 32cae32168a8d5048ec79f4b69c9d687d4645b69 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Wed, 1 Jul 2020 13:17:11 +0100 Subject: [PATCH] Prep for release --- .travis.yml | 10 ++++++++++ README.md | 18 ++++++++---------- project/plugins.sbt | 3 ++- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa4e8ce..3c00c05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index 7d4fd54..499cfa3 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/project/plugins.sbt b/project/plugins.sbt index 5f5ea55..4a819b3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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")