#!/usr/bin/env python3 import os import sys 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 = 0 problems += license.lint("util/header-gpl3.txt", glob.glob("src/**/*.cpp") + glob.glob("src/**/*.h"), True) # restore stash os.system("git stash pop -q") sys.exit(problems)