diff --git a/snippets/grep.fish b/snippets/grep.fish new file mode 100644 index 0000000..d229829 --- /dev/null +++ b/snippets/grep.fish @@ -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 ) diff --git a/snippets/lefthook.yml b/snippets/lefthook.yml new file mode 100644 index 0000000..5a43957 --- /dev/null +++ b/snippets/lefthook.yml @@ -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 )