diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 7e60c0d..89f44d3 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -2,7 +2,6 @@ # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. - name: Scala CI on: @@ -26,8 +25,8 @@ jobs: java-version: '11' distribution: 'temurin' cache: 'sbt' - - name: Run tests - run: sbt test + - name: Check formatting & Run Tests + run: sbt fmtCheck test # Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository - name: Upload dependency graph - uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91 + uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91 \ No newline at end of file diff --git a/.github/workflows/semantic-commit-linter.yml b/.github/workflows/semantic-commit-linter.yml index a03b7dc..c96bd98 100644 --- a/.github/workflows/semantic-commit-linter.yml +++ b/.github/workflows/semantic-commit-linter.yml @@ -20,4 +20,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: scopes: RE-\d+ - requireScope: false + requireScope: false \ No newline at end of file diff --git a/.github/workflows/semantic-tagging.yaml b/.github/workflows/semantic-tagging.yaml new file mode 100644 index 0000000..c91f358 --- /dev/null +++ b/.github/workflows/semantic-tagging.yaml @@ -0,0 +1,15 @@ +name: Semantic Tagging +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Bump version and push tag + uses: hennejg/github-tag-action@v4.3.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.scalafix.conf b/.scalafix.conf index 0c65d47..126dea2 100644 --- a/.scalafix.conf +++ b/.scalafix.conf @@ -2,14 +2,15 @@ rules = [ OrganizeImports ] OrganizeImports { blankLines = Auto - coalesceToWildcardImportThreshold = 2 + coalesceToWildcardImportThreshold = 3 expandRelative = false groupExplicitlyImportedImplicitsSeparately = false groupedImports = AggressiveMerge groups = [ - "*" - "re:(javax?|scala|dotty)\\." + "re:(dotty)\\." + "re:(scala)\\." "re:(io\\.github\\.polentino\\.)" + "*" ] importSelectorsOrder = Ascii importsOrder = Ascii diff --git a/build.sbt b/build.sbt index da0e86e..3d637f3 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -ThisBuild / version := "0.3.0-SNAPSHOT" +ThisBuild / version := "0.3.0" ThisBuild / scalaVersion := "3.1.3" ThisBuild / publishMavenStyle := true @@ -79,5 +79,5 @@ lazy val redactedTests = (project in file("tests")) } ) -addCommandAlias("fmt", "; scalafmtAll ; scalafmtSbt") // todo scalafix ? +addCommandAlias("fmt", "; scalafix; scalafmtAll; scalafmtSbt") addCommandAlias("fmtCheck", "; scalafmtCheckAll ; scalafmtSbtCheck") diff --git a/plugin/src/main/scala/io/github/polentino/redacted/helpers/PluginOps.scala b/plugin/src/main/scala/io/github/polentino/redacted/helpers/PluginOps.scala index d8de7fa..9fb0e6a 100644 --- a/plugin/src/main/scala/io/github/polentino/redacted/helpers/PluginOps.scala +++ b/plugin/src/main/scala/io/github/polentino/redacted/helpers/PluginOps.scala @@ -1,19 +1,20 @@ package io.github.polentino.redacted.helpers import dotty.tools.dotc.* -import dotty.tools.dotc.ast.{tpd, *} import dotty.tools.dotc.ast.tpd.* import dotty.tools.dotc.ast.untpd.Modifiers -import dotty.tools.dotc.core.* +import dotty.tools.dotc.ast.{tpd, *} import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.Symbols.* +import dotty.tools.dotc.core.* import dotty.tools.dotc.util.Spans.Span -import io.github.polentino.redacted.helpers.AstOps.* import scala.util.{Failure, Success, Try} +import io.github.polentino.redacted.helpers.AstOps.* + object PluginOps { private val TO_STRING_NAME = "toString" diff --git a/plugin/src/main/scala/io/github/polentino/redacted/phases/PatchToString.scala b/plugin/src/main/scala/io/github/polentino/redacted/phases/PatchToString.scala index f516cbf..ff11f25 100644 --- a/plugin/src/main/scala/io/github/polentino/redacted/phases/PatchToString.scala +++ b/plugin/src/main/scala/io/github/polentino/redacted/phases/PatchToString.scala @@ -2,16 +2,16 @@ package io.github.polentino.redacted.phases import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.* -import dotty.tools.dotc.core.Symbols -import dotty.tools.dotc.core.Names +import dotty.tools.dotc.core.{Names, Symbols} import dotty.tools.dotc.plugins.PluginPhase import dotty.tools.dotc.report import dotty.tools.dotc.transform.Pickler -import io.github.polentino.redacted.helpers.PluginOps.* -import io.github.polentino.redacted.helpers.AstOps.* import scala.util.Try +import io.github.polentino.redacted.helpers.AstOps.* +import io.github.polentino.redacted.helpers.PluginOps.* + final case class PatchToString() extends PluginPhase { override val runsAfter: Set[String] = Set(Pickler.name)