From 347881f713af59a0a6d9ddb42bf0668a9359ed37 Mon Sep 17 00:00:00 2001 From: Marc BARBIER Date: Tue, 29 Jun 2021 11:39:19 +0200 Subject: [PATCH] changement numerotation --- pre-commit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pre-commit b/pre-commit index d023bad..a70ff3d 100755 --- a/pre-commit +++ b/pre-commit @@ -9,8 +9,8 @@ class termColor: ERR = '\033[91m' -# 1 = critical 0 = warning any other value => info -banned=[["console.log",1], ["<<<< HEAD",1]] +# 0 = critical 1 = warning any other value => info +banned=[["console.log",0], ["<<<< HEAD",0]] triggred=0 result = subprocess.run(['git', 'diff', '--staged'], stdout=subprocess.PIPE) @@ -20,9 +20,9 @@ for file in files: for check in banned: if check[0] in file: code = "" # info => nocolor - if check[1] == 1: - code = termColor.ERR if check[1] == 0: + code = termColor.ERR + if check[1] == 1: code = termColor.WARN print(code + check[0] + " detected in:") print(file.split("\n")[0].split(" b/")[0])