Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/repo_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def check(staged, base, head, repository=None, upstream=()):
config = Path(tmp) / 'gitleaks.toml'
config.write_text('[extend]\nuseDefault = true\n')
args = ['gitleaks', 'protect' if staged else 'detect', '--no-banner',
'--redact', '--log-level=error', '--config', str(config),
'--redact', '--verbose', '--log-level=error', '--config', str(config),
'--gitleaks-ignore-path', os.devnull, '--ignore-gitleaks-allow']
args += ['--staged'] if staged else [
'--log-opts', ' '.join([f'{base}..{head}', *upstream_exclusion(upstream)])]
Expand Down
3 changes: 3 additions & 0 deletions tests/test_repo_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ def test_local_allowance_never_waives_secrets(self):
self.local_allow().write_text('runs/**\tLocal scratch output\n')
result = self.gate()
self.assertEqual(result.returncode, 1) # gitleaks still runs and blocks
output = result.stdout + result.stderr
self.assertIn('runs/notes.txt', output) # the blocked finding is named
self.assertNotIn(token, output) # but its secret is redacted

def test_local_allowance_rejects_identities_and_absolute_paths(self):
self.add('runs/output.npz')
Expand Down