2022-07-02 17:20:01 +02:00
|
|
|
---
|
2021-08-08 00:48:18 +02:00
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
|
|
rev: v4.0.1
|
|
|
|
hooks:
|
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: check-toml
|
2021-09-22 08:37:42 +02:00
|
|
|
- id: check-yaml
|
|
|
|
exclude: .drone.yml # drone's yaml is somewhat strange sometimes
|
2022-07-02 17:18:27 +02:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
2022-09-28 15:55:50 +02:00
|
|
|
- id: hugo-version-check
|
|
|
|
name: hugo version check
|
|
|
|
entry: |
|
|
|
|
bash -c "
|
|
|
|
files='.drone.yml Dockerfile'
|
2023-07-29 17:06:39 +02:00
|
|
|
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)
|
2022-09-28 15:55:50 +02:00
|
|
|
if [ $count -gt 1 ]; then
|
|
|
|
echo hugo versions inconsistent:
|
2023-07-29 17:06:39 +02:00
|
|
|
grep -noE --color=always '(hugo-v)[0-9].[0-9].[0-9].[0-9]' $files
|
2022-09-28 15:55:50 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
"
|
|
|
|
language: system
|
|
|
|
pass_filenames: false
|
2022-07-02 17:18:27 +02:00
|
|
|
- id: check-compose-file
|
|
|
|
name: check compose file
|
|
|
|
language: system
|
|
|
|
entry: docker-compose -f docker-compose.yml config
|
|
|
|
pass_filenames: false
|
2022-08-02 15:13:39 +02:00
|
|
|
- id: yamllint
|
|
|
|
name: yamllint
|
|
|
|
language: system
|
|
|
|
entry: yamllint .
|
|
|
|
pass_filenames: false
|
2022-08-08 16:46:52 +02:00
|
|
|
- repo: https://git.dotya.ml/wanderer/hadolint-pre-commit
|
|
|
|
rev: v0.0.1
|
|
|
|
hooks:
|
|
|
|
- id: hadolint-container
|
2022-08-08 15:20:50 +02:00
|
|
|
- repo: https://github.com/dnephin/pre-commit-golang
|
|
|
|
rev: v0.5.0
|
|
|
|
hooks:
|
|
|
|
- id: go-mod-tidy
|
|
|
|
- id: go-unit-tests
|
|
|
|
- id: golangci-lint
|
|
|
|
- id: go-build
|
2022-07-02 17:20:01 +02:00
|
|
|
...
|