summaryrefslogtreecommitdiff
path: root/tools/test_format.py
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-02-12 15:20:32 -0500
committerGitHub <noreply@github.com>2019-02-12 15:20:32 -0500
commit0b0d962eb9cf6e41f840a65d3718c4d0a12eeb54 (patch)
tree59a0b29d70c3a3bbbac4748d9d906d1cb67bb906 /tools/test_format.py
parent9240f9b57f464318802030033e10f7a6250d5506 (diff)
Revert "Rewrite tools/format.py in deno (#1528)" (#1752)
tools/format.ts is making CI flaky and it's difficult to run right now. Reverting to tools/format.py This reverts commit f19622e7681b7753788137706e535f72c3ebb38e.
Diffstat (limited to 'tools/test_format.py')
-rwxr-xr-xtools/test_format.py28
1 files changed, 3 insertions, 25 deletions
diff --git a/tools/test_format.py b/tools/test_format.py
index 2e26f2199..a0d5ba08e 100755
--- a/tools/test_format.py
+++ b/tools/test_format.py
@@ -1,40 +1,18 @@
#!/usr/bin/env python
-# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-# This program fails if ./tools/format.ts changes any files.
+# This program fails if ./tools/format.py changes any files.
-import os
import sys
import util
import sys
import subprocess
-from distutils.spawn import find_executable
-
-
-def lookup_deno_path():
- deno_exe = "deno" + util.executable_suffix
- release_deno = os.path.join(util.root_path, "target", "release", deno_exe)
- debug_deno = os.path.join(util.root_path, "target", "debug", deno_exe)
-
- if os.path.exists(release_deno):
- return release_deno
- if os.path.exists(debug_deno):
- return debug_deno
-
- return find_executable("deno")
def main():
- deno_path = lookup_deno_path()
-
- if not deno_path:
- print "No available deno executable."
- sys.exit(1)
-
- util.run([deno_path, "--allow-read", "--allow-run", "tools/format.ts"])
+ 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.ts "
+ print "Run tools/format.py "
print output
sys.exit(1)