浏览代码

Lint python commit script to satisfy PEP8 (#893)

Alex 3 年之前
父节点
当前提交
35f2ea5da2
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      scripts/pre-commit.py

+ 8 - 3
scripts/pre-commit.py

@@ -1,13 +1,18 @@
 #!/usr/bin/env python3
-import os,sys
+"""Helper script to be used as a pre-commit hook."""
+import os
+import sys
 import subprocess
 
+
 def gitleaksEnabled():
+    """Determine if the pre-commit hook for gitleaks is enabled."""
     out = subprocess.getoutput("git config --bool hooks.gitleaks")
     if out == "false":
         return False
     return True
 
+
 if gitleaksEnabled():
     exitCode = os.WEXITSTATUS(os.system('gitleaks protect -v --staged'))
     if exitCode == 1:
@@ -18,5 +23,5 @@ To disable the gitleaks precommit hook run the following command:
 ''')
         sys.exit(1)
 else:
-    print('gitleaks precommit disabled (enable with `git config hooks.gitleaks true`)')
-
+    print('gitleaks precommit disabled\
+     (enable with `git config hooks.gitleaks true`)')