2018-10-21 13:43:47 -04:00
|
|
|
#!/usr/bin/env python
|
2020-09-21 08:26:41 -04:00
|
|
|
# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2019-02-12 15:20:32 -05:00
|
|
|
# This program fails if ./tools/format.py changes any files.
|
2018-10-21 13:43:47 -04:00
|
|
|
|
|
|
|
import sys
|
|
|
|
import subprocess
|
2019-09-11 16:47:42 -04:00
|
|
|
import util
|
2018-10-21 13:43:47 -04:00
|
|
|
|
|
|
|
|
2018-11-30 03:27:41 -05:00
|
|
|
def main():
|
2019-02-12 15:20:32 -05:00
|
|
|
util.run([sys.executable, "tools/format.py"])
|
2019-06-08 07:46:57 -04:00
|
|
|
result = util.run_output(
|
|
|
|
["git", "status", "-uno", "--porcelain", "--ignore-submodules"],
|
|
|
|
exit_on_fail=True)
|
|
|
|
if result.out:
|
2020-10-01 19:59:53 -04:00
|
|
|
print("Run tools/format.py ")
|
|
|
|
print(result.out)
|
2018-10-21 13:43:47 -04:00
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2018-11-30 03:27:41 -05:00
|
|
|
main()
|