add .pre-commit-config.yaml [skip ci]

this finally fixes #1
This commit is contained in:
surtur 2022-09-27 22:53:02 +02:00
parent 9fe738e670
commit 18f8a00818
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

19
.pre-commit-config.yaml Normal file

@ -0,0 +1,19 @@
---
repos:
- repo: local
hooks:
- id: hugo-version-check
name: hugo version check
entry: |
bash -c "
files='.drone.yml Containerfile'
count=$(grep -oE '( |hugo-v)[0-9].[0-9].[0-9].[0-9]' $files | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/hugo-v//g' | uniq | wc -l)
if [ $count -gt 1 ]; then
echo hugo versions inconsistent:
grep -noE --color=always '( |hugo-v)[0-9].[0-9].[0-9].[0-9]' $files
exit 1
fi
"
language: system
pass_filenames: false
...