From 18f8a008185fc48a77d2d893c4a1ccfb2ef356bb Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 27 Sep 2022 22:53:02 +0200 Subject: [PATCH] add .pre-commit-config.yaml [skip ci] this finally fixes #1 --- .pre-commit-config.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0927ba7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 +...