From 306db4d78873e571827f40625496cdc7098864ce Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 19 Apr 2017 20:23:40 -0400 Subject: [PATCH] Check for git diff at Travis CI --- .travis.yml | 2 +- build.sbt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c39d887fa..59cb0e286 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" diff --git a/build.sbt b/build.sbt index 9e29538bf..61a2df4f9 100644 --- a/build.sbt +++ b/build.sbt @@ -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" ::