-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
.pre-commit-config.yaml
45 lines (45 loc) · 1.3 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
# ==============================================================================
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# ==============================================================================
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
# Bash helper hooks (local)
#
- repo: local
hooks:
# shellcheck (aliased to shck)
#
- id: shellcheck
name: Run static analysis (shellcheck)
entry: shellcheck
language: system
files: \.(sh|bash)$
types: [file]
alias: shck
args: [ '-x', '-e', 'SC2034' ]
# shfmt
#
- id: shfmt
name: Run lint check (shfmt -d)
entry: shfmt
language: system
files: \.(sh|bash)$
types: [file]
args: [ '-i', '0', '-ci', '-sr', '-d' ]
# shfmt -w (must manually invoke)
#
- id: shfmtw
name: Auto-fix lint errors (shfmt -w)
entry: shfmt
language: system
stages: [manual]
files: \.(sh|bash)$
types: [file]
args: [ '-i', '0', '-ci', '-sr', '-kp', '-w' ]