chore(lefthook): detect unwanted data

This commit is contained in:
Michele Cereda
2025-02-10 22:23:29 +01:00
parent a65024f849
commit 7d436627b6
2 changed files with 12 additions and 0 deletions

5
snippets/grep.fish Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env fish
# Check unwanted data
# Show file name and line number
! grep -EHinr -e 'some' -e 'regexp' * || ( echo 'unwanted data found' >&2 && false )

7
snippets/lefthook.yml Normal file
View File

@@ -0,0 +1,7 @@
---
pre-commit:
commands:
check-unwanted-data:
run: >-
! ( grep -Hin -e 'example.org' -e '012345678901' {staged_files} )
|| ( printf %b '\n' 'found possibly unwanted data' >&2 && false )