diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..68f97d3fc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - id: talisman-commit + name: talisman + entry: talisman --githook pre-commit + stages: [ commit ] + # talisman currently discovers files by itself and does not take them on the cli + pass_filenames: false + types: [ text ] + language: golang + - id: gitleaks + name: Detect hardcoded secrets + description: Detect hardcoded secrets using Gitleaks + entry: gitleaks protect --verbose --redact --staged + language: golang + pass_filenames: false + - id: gitleaks-docker + name: Detect hardcoded secrets + description: Detect hardcoded secrets using Gitleaks + entry: zricethezav/gitleaks protect --verbose --redact --staged + language: docker_image + - id: gitleaks-system + name: Detect hardcoded secrets + description: Detect hardcoded secrets using Gitleaks + entry: gitleaks protect --verbose --redact --staged + language: system + - id: pretty-format-java + name: Google Java Formatter + description: Runs Google Java Formatter over Java source files + entry: pretty-format-java + language: python + types: [ java ] + # this is needed because the hook downloads google-java-formatter and + # we don't have yet a nice way of ensuring a single download over multiple runs + require_serial: true + minimum_pre_commit_version: '1' + +