19 lines
460 B
Python
Executable File
19 lines
460 B
Python
Executable File
#!/usr/bin/python3
|
|
import subprocess
|
|
import sys
|
|
|
|
banned=["console.log", "<<<< HEAD"]
|
|
|
|
triggred=0
|
|
result = subprocess.run(['git', 'diff', '--staged'], stdout=subprocess.PIPE)
|
|
diff = result.stdout.decode("utf-8")
|
|
files = diff.split("diff --git a/")
|
|
for file in files:
|
|
for check in banned:
|
|
if check in file:
|
|
print(check + " detected in:")
|
|
print(file.split("\n")[0].split(" b/")[0])
|
|
triggred=1
|
|
|
|
sys.exit(triggred)
|