Check for git diff at Travis CI

This commit is contained in:
Eugene Yokota 2017-04-19 20:23:40 -04:00
parent 9d87e6b3d4
commit 306db4d788
2 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,7 @@ matrix:
env:
matrix:
- SBT_CMD=";test:compile;scalariformCheck"
- SBT_CMD=";test:compile;scalafmtCheck"
- SBT_CMD="mimaReportBinaryIssues"
- SBT_CMD="safeUnitTests"
- SBT_CMD="otherUnitTests"

View File

@ -361,6 +361,13 @@ def customCommands: Seq[Setting[_]] = Seq(
otherUnitTests := {
test.all(otherProjects).value
},
commands += Command.command("scalafmtCheck") { state =>
sys.process.Process("git diff --name-only --exit-code").! match {
case 0 => // ok
case x => sys.error("git diff detected! Did you compile before committing?")
}
state
},
commands += Command.command("release-sbt-local") { state =>
"clean" ::
"so compile" ::