diff --git a/.git-hooks/detect-api-keys.py b/.git-hooks/detect-api-keys.py index a050de76..8d4092a9 100755 --- a/.git-hooks/detect-api-keys.py +++ b/.git-hooks/detect-api-keys.py @@ -61,12 +61,12 @@ def main(argv=None): if match != None: files_with_key.append((name, filename, i + 1, match.end())) - if files_with_key: - for file in files_with_key: - print(key_found_message(file)) - return 1 - else: - return 0 + if files_with_key: + for file in files_with_key: + print(key_found_message(file)) + return 1 + else: + return 0 if __name__ == "__main__": diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b056502..8d793e0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,3 +16,4 @@ repos: description: Checks for AWS or Datadog API keys entry: ".git-hooks/detect-api-keys.py" language: python + exclude: tests