Skip to content

Commit

Permalink
run CI scalafixAll with local scalafix-interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed Jun 11, 2023
1 parent ab1b140 commit 67f5009
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: coursier/setup-action@v1
- run: sbt "scalafixAll --check"
- run: sbt "dogfoodScalafixInterfaces; scalafixAll --check"
- run: ./bin/scalafmt --test
mima:
name: Version Policy
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inThisBuild(
onLoadMessage := s"Welcome to scalafix ${version.value}",
semanticdbEnabled := true,
semanticdbVersion := scalametaV,
scalafixScalaBinaryVersion := "2.13",
scalafixScalaBinaryVersion := "2.13"
)
)

Expand Down
21 changes: 20 additions & 1 deletion project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,25 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
"interfaces/doc" ::
s
},
commands += Command.command("dogfoodScalafixInterfaces") { state =>
val extracted = Project.extract(state)
val v =
(ThisBuild / version)
.get(extracted.structure.data)
.get
val suffix =
(ThisBuild / scalafixScalaBinaryVersion)
.get(extracted.structure.data)
.get
.replace('.', '_')

s"all cli$suffix/publishLocalTransitive interfaces/publishLocal" ::
"reload plugins" ::
s"""set dependencyOverrides += "ch.epfl.scala" % "scalafix-interfaces" % "$v"""" :: // as documented in installation.md
"session save" ::
"reload return" ::
state
},
Test / publishArtifact := false,
licenses := Seq(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
Expand All @@ -192,7 +211,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
Some("^\\d+\\.\\d+\\.\\d+\\+\\d+".r),
versionScheme := Some("early-semver"),
// coursier-versions always return false for the *.*.*.*-r pattern jgit uses
libraryDependencySchemes += Dependencies.jgit.withRevision("always"),
libraryDependencySchemes += Dependencies.jgit.withRevision("always")
)

override def projectSettings: Seq[Def.Setting[_]] = List(
Expand Down

0 comments on commit 67f5009

Please sign in to comment.