-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
82 lines (74 loc) · 2.25 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Run these commands at repo root to enable pre-commit in local development environment
# brew install pre-commit
# pre-commit install
# pre-commit install --hook-type commit-msg
# pre-commit install --hook-type pre-push
# Refer https://pre-commit.com for more information
# Refer https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
stages: [push]
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: mixed-line-ending
args: [--fix=lf]
- id: check-json
types: [file] # override `types: [json]`
files: \.(json|json\.tpl)$
- id: pretty-format-json
types: [file] # override `types: [json]`
files: \.(json|json\.tpl)$
args: [--autofix]
# pre-commit hook to verify commit messages are conventional commit compliant
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
hooks:
- id: commitizen
stages: [commit-msg]
# tfupdate hook should run before go-generate, so that we can see if the docs
# are properly updated.
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
hooks:
- id: terraform_fmt
#- id: tfupdate
# name: Auto update hashicorp/random provider version
# args:
# - --args=provider random
# pre-commit hooks for golang
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-generate
- id: go-vet
exclude: tools
- id: golangci-lint
- id: go-mod-tidy
# Lint: Dockerfile
- repo: https://github.com/hadolint/hadolint.git
rev: v2.12.1-beta
hooks:
- id: hadolint-docker
# Lint: protofile
- repo: https://github.com/yoheimuta/protolint
rev: v0.44.0
hooks:
- id: protolint
# Lint: Bash scripts
- repo: https://github.com/openstack-dev/bashate.git
rev: 2.1.1
hooks:
- id: bashate
# Lint: Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
exclude: import.sh
args: [ "-x" ]