-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
116 lines (113 loc) · 3.72 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
exclude: ^ansible/collections/
# default_language_version:
# python: python3.8
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# to check the files types these support:
# https://github.com/pre-commit/pre-commit-hooks/blob/main/.pre-commit-hooks.yaml
# Python file tests
# - id: double-quote-string-fixer # only Python files
# text file tests
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
args:
- --assume-in-merge
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
args:
- --allow-multiple-documents
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=no
- id: no-commit-to-branch
- id: pretty-format-json
args:
- --autofix
- id: sort-simple-yaml
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md,tpl
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
hooks:
- id: prettier
# override the hook's command to not edit the files in-place
entry: prettier
exclude: ^packages\/.*
args:
- --config
- .prettierrc.yaml
- --write
- --ignore-unknown
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
exclude_types:
- zsh
args:
# more args in .shellcheckrc
- --check-sourced
- --color=always
- --enable=all
- --severity=error
- --wiki-link-count=50
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-1
hooks:
- id: shfmt
args:
# more args in .editorconfig (though it seems shfmt doesn't actually honor those...)
- --indent=3 # 0 for tabs (default), >0 for number of spaces
- --binary-next-line # binary ops like && and | may start a line
- --case-indent # switch cases will be indented
- --keep-padding # keep column alignment paddings
- --list # list files whose formatting differs from shfmt's
# - --simplify # simplify the code
# - --minify # minify the code to reduce its size (implies -s)
# - --diff # error with a diff when the formatting differs
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: b3e3a39d35aee80c3ed21255fd5816f3752039d1 # v2.7.2
hooks:
- id: editorconfig-checker
alias: ec
args:
- -config
- ci/.ecrc.json
- repo: https://github.com/hadolint/hadolint # for linting Dockerfiles
# there's a breaking issue:
# https://github.com/hadolint/hadolint/issues/886
rev: v2.12.0
hooks:
- id: hadolint-docker
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
# - repo: https://github.com/psf/black # this is for python code
# rev: 22.3.0
# hooks:
# - id: black
# - repo: https://github.com/streetsidesoftware/cspell-cli
# rev: v6.0.0
# hooks:
# - id: cspell
# # entry: codespell --relative
# args: [--relative, --no-progress, --no-summary]
# name: Spell check with cspell
# - repo: https://github.com/adrienverge/yamllint