summaryrefslogtreecommitdiff
path: root/scripts/internal/git_pre_commit.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/internal/git_pre_commit.py')
-rwxr-xr-xscripts/internal/git_pre_commit.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/internal/git_pre_commit.py b/scripts/internal/git_pre_commit.py
index 87783627..dad0066b 100755
--- a/scripts/internal/git_pre_commit.py
+++ b/scripts/internal/git_pre_commit.py
@@ -107,16 +107,16 @@ def main():
# space at end of line
if line.endswith(' '):
print("%s:%s %r" % (path, lineno, line))
- return exit("space at end of line")
+ return sys.exit("space at end of line")
line = line.rstrip()
# # pdb (now provided by flake8-debugger plugin)
# if "pdb.set_trace" in line:
# print("%s:%s %s" % (path, lineno, line))
- # return exit("you forgot a pdb in your python code")
+ # return sys.exit("you forgot a pdb in your python code")
# # bare except clause (now provided by flake8-blind-except plugin)
# if "except:" in line and not line.endswith("# NOQA"):
# print("%s:%s %s" % (path, lineno, line))
- # return exit("bare except clause")
+ # return sys.exit("bare except clause")
# Python linters
if py_files:
@@ -125,28 +125,28 @@ def main():
cmd = "%s -m flake8 --config=.flake8 %s" % (PYTHON, " ".join(py_files))
ret = subprocess.call(shlex.split(cmd))
if ret != 0:
- return exit("python code didn't pass 'flake8' style check; "
- "try running 'make fix-flake8'")
+ return sys.exit("python code didn't pass 'flake8' style check; "
+ "try running 'make fix-flake8'")
# isort
cmd = "%s -m isort --check-only %s" % (
PYTHON, " ".join(py_files))
ret = subprocess.call(shlex.split(cmd))
if ret != 0:
- return exit("python code didn't pass 'isort' style check; "
- "try running 'make fix-imports'")
+ return sys.exit("python code didn't pass 'isort' style check; "
+ "try running 'make fix-imports'")
# C linter
if c_files:
# XXX: we should escape spaces and possibly other amenities here
cmd = "%s scripts/internal/clinter.py %s" % (PYTHON, " ".join(c_files))
ret = subprocess.call(cmd, shell=True)
if ret != 0:
- return exit("C code didn't pass style check")
+ return sys.exit("C code didn't pass style check")
if new_rm_mv:
out = sh("%s scripts/internal/generate_manifest.py" % PYTHON)
with open_text('MANIFEST.in') as f:
if out.strip() != f.read().strip():
- exit("some files were added, deleted or renamed; "
- "run 'make generate-manifest' and commit again")
+ sys.exit("some files were added, deleted or renamed; "
+ "run 'make generate-manifest' and commit again")
main()