diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-21 13:43:47 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-21 13:59:53 -0700 |
commit | 47c96a61527f56aa6dfc5a8fc44b13a1db4f4da5 (patch) | |
tree | 20256b9e73b69be6750c39a2f1e02ba99fa89fc0 | |
parent | ae0dec39dacbfa4279d1d708bf6b7488c230c272 (diff) |
CI should fail when code isn't formatted.
-rw-r--r-- | .appveyor.yml | 1 | ||||
-rw-r--r-- | .travis.yml | 1 | ||||
-rwxr-xr-x | tools/test_format.py | 21 |
3 files changed, 23 insertions, 0 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 98673ab1d..df5fc870a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -365,6 +365,7 @@ build_script: test_script: - python tools\lint.py + - python tools\test_format.py - ps: Exec { & python tools\test.py $env:DENO_BUILD_PATH } after_test: diff --git a/.travis.yml b/.travis.yml index 314ece40d..a61d5afab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,6 +87,7 @@ before_script: - ./tools/setup.py script: - ./tools/lint.py +- ./tools/test_format.py - bash -c "sleep 2100; pkill ninja" & - ./tools/build.py -j2 - ./tools/test.py $DENO_BUILD_PATH diff --git a/tools/test_format.py b/tools/test_format.py new file mode 100755 index 000000000..5e93286b6 --- /dev/null +++ b/tools/test_format.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# This program fails if ./tools/format.py changes any files. + +import sys +import util +import sys +import subprocess + + +def main(argv): + util.run([sys.executable, "tools/format.py"]) + output = util.run_output( + ["git", "status", "-uno", "--porcelain", "--ignore-submodules"]) + if len(output) > 0: + print "Run tools/format.py " + print output + sys.exit(1) + + +if __name__ == '__main__': + main(sys.argv) |