Skip to content

Commit d9dcadb

Browse files
committed
Simplify detect-secrets workflow with single-source-of-truth script
Move detect-secrets args into scripts/detect_secrets_baseline.sh so the pre-commit hook and baseline regeneration (`scripts/detect_secrets_baseline.sh scan`) always use identical arguments. Adds slim-detect-secrets to dev extras so the system-install local hook can find detect-secrets-hook.
1 parent 9e35be4 commit d9dcadb

4 files changed

Lines changed: 77 additions & 484 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,10 @@ repos:
4747
stages: [push]
4848
pass_filenames: false
4949

50-
- repo: https://github.com/NASA-AMMOS/slim-detect-secrets
51-
# using commit id for now, will change to tag when official version is released
52-
rev: 91e097ad4559ae6ab785c883dc5ed989202c7fbe
50+
- repo: local
5351
hooks:
54-
- id: detect-secrets
55-
args:
56-
- '--disable-plugin'
57-
- 'AbsolutePathDetectorExperimental'
58-
- '--baseline'
59-
- '.secrets.baseline'
60-
- --exclude-files '\.secrets..*'
61-
- --exclude-files '\.git.*'
62-
- --exclude-files '\.pre-commit-config\.yaml'
63-
- --exclude-files '\.mypy_cache'
64-
- --exclude-files '\.pytest_cache'
65-
- --exclude-files '\.tox'
66-
- --exclude-files '\.venv'
67-
- --exclude-files 'venv'
68-
- --exclude-files 'dist'
69-
- --exclude-files 'build'
70-
- --exclude-files '.*\.egg-info'
71-
- --exclude-files '.*/test/.*'
72-
- --exclude-files '.*/test/data/.*'
73-
- --exclude-files '.*/tests/data/.*'
74-
- --exclude-files '.*/test.*/data/.*'
75-
- --exclude-files '.*/.*test.*/data/.*'
76-
- --exclude-files 'src/.*/test/data/.*'
77-
- --exclude-files 'tests/data/.*'
52+
- id: detect-secrets
53+
name: detect-secrets
54+
entry: scripts/detect_secrets_baseline.sh
55+
language: script
56+
pass_filenames: true

0 commit comments

Comments
 (0)