diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-03-23 13:30:29 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-03-23 13:30:29 +0100 |
commit | 3149525c2bb845b5440c9749acded484d009e6ac (patch) | |
tree | dd8b69183b067f24057728ace06b25f707cce5f8 /util/pre-commit.py | |
parent | Blocker fixes (diff) | |
download | smolbote-3149525c2bb845b5440c9749acded484d009e6ac.tar.xz |
Rewrote the pre-commit hook into Ruby
Diffstat (limited to 'util/pre-commit.py')
-rwxr-xr-x | util/pre-commit.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/util/pre-commit.py b/util/pre-commit.py deleted file mode 100755 index ca1dc35..0000000 --- a/util/pre-commit.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import glob -import license - -# stash unstaged files before running test -#os.system("git stash -q --keep-index") - -#print("Running pre-commit hook in {0}".format(os.getcwd())) -problems = False - -# check license -print("Checking license...") -if license.lint("util/header-gpl3.txt", glob.glob("src/**/*.cpp") + glob.glob("src/**/*.h"), True) > 0: - problems = True - print("Run <<./util/license.py -l util/header-gpl3.txt src/**/*.cpp src/**/*.h>> to autofix") - -# check style -print("Checking style...") -astyle = subprocess.run(['astyle', '--dry-run', '--formatted', '--options=astyle.rc'] + glob.glob("src/**/*.cpp") + glob.glob("src/**/*.h"), stdout=subprocess.PIPE) -if len(astyle.stdout.splitlines()) > 0: - problems = True - for line in astyle.stdout.splitlines(): - print(line.decode('utf-8')) - print("Run <<astyle --options=astyle.rc --suffix=none src/**/*.cpp src/**/*.h>> to autofix") - -# restore stash -#os.system("git stash pop -q") - -if problems: - sys.exit(-1) -else: - sys.exit(0) |