Skip to content

Commit fb7ecc2

Browse files
committed
Add a prePR sbt command and remove scalafix on compile
1 parent 90622a5 commit fb7ecc2

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.scalafix.conf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
rules = []
2-
3-
// Run automatically via (scalafixOnCompile := true)
4-
triggered.rules = [
1+
rules = [
52
GenerateApiReport,
63
]

build.sbt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ lazy val root = project
1414
.enablePlugins(ScalaJSPlugin)
1515
.enablePlugins(ScalafixPlugin)
1616
.dependsOn(scalafixRules % ScalafixConfig)
17-
.settings(scalafixOnCompile := true)
1817

1918
name := "Scala.js DOM"
2019

@@ -123,3 +122,15 @@ lazy val example = project.
123122
settings(commonSettings: _*).
124123
settings(noPublishSettings: _*).
125124
dependsOn(root)
125+
126+
addCommandAlias("prePR", "+prePR_nonCross")
127+
128+
val prePR_nonCross = taskKey[Unit]("Performs all necessary work required before submitting a PR, for a single version of Scala.")
129+
130+
ThisBuild / prePR_nonCross := Def.sequential(
131+
root / clean,
132+
root / Compile / scalafmt,
133+
root / Compile / compile,
134+
(root / Compile / scalafix).toTask(""),
135+
example / Compile / compile,
136+
).value

scalafix/src/main/scala/org/scalajs/dom/scalafix/GenerateApiReport.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class GenerateApiReport extends SemanticRule("GenerateApiReport") {
121121
|$api
122122
|""".stripMargin
123123

124+
println(s"[info] Generating $reportFile")
124125
Files.write(reportFile, content.getBytes(StandardCharsets.UTF_8))
125126
}
126127
}

0 commit comments

Comments
 (0)