Update verifyCodeStyle and applyCodeStyle to be what we really require (#30777)

Previously it included a coarse grained Java reformat which it seems was never
quite worked through (reformatting generated sources etc), so go back on that,
and make sure verifyCodeStyle is exactly what we require for PR validation to pass
(and that it does not diverge)
This commit is contained in:
Johan Andrén 2021-10-13 08:21:09 +02:00 committed by GitHub
parent 93a748b952
commit b859d9fc48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 16 deletions

View file

@ -32,7 +32,7 @@ jobs:
sbt -jvm-opts .jvmopts-ci \
-Dsbt.override.build.repos=false \
-Dsbt.log.noformat=false \
scalafmtCheckAll scalafmtSbtCheck headerCheckAll
verifyCodeStyle
pull-request-validation:
name: Check / Tests

View file

@ -12,21 +12,8 @@ enablePlugins(
JavaFormatterPlugin)
disablePlugins(MimaPlugin)
// check format and headers
TaskKey[Unit]("verifyCodeFmt") := {
javafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ =>
throw new MessageOnlyException(
"Unformatted Java code found. Please run 'javafmtAll' (or use the 'applyCodeStyle' alias) and commit the reformatted code")
}
scalafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ =>
throw new MessageOnlyException(
"Unformatted Scala code found. Please run 'scalafmtAll' (or use the 'applyCodeStyle' alias) and commit the reformatted code")
}
}
addCommandAlias("verifyCodeStyle", "headerCheckAll; verifyCodeFmt")
addCommandAlias("applyCodeStyle", "headerCreateAll; javafmtAll; scalafmtAll")
addCommandAlias("verifyCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck; headerCheckAll")
addCommandAlias("applyCodeStyle", "headerCreateAll; scalafmtAll; scalafmtSbtAll")
addCommandAlias(
name = "fixall",