-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path.pre-commit-config.yaml
102 lines (94 loc) · 2.88 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
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
args: [--unsafe]
- id: check-json
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
exclude: ^docs/man/.*$
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
exclude: ^tests/test_.*$
- id: fix-byte-order-marker
- id: check-case-conflict
# Beautify shell scripts
# Deactivated because of an issue with deprecated python dependencies.
# See https://github.com/lovesegfault/beautysh/issues/248 and its fix to re-activate
# - repo: https://github.com/lovesegfault/beautysh.git
# rev: v6.2.1
# hooks:
# - id: beautysh
# exclude: (?x)^(tests/test_(.*))$
# args: [-i, "2"]
# Run local script
- repo: local
hooks:
- id: local-precommit-script
name: Run local script before commit if it exists
language: system
entry: bash -c '[ ! -x local.sh ] || ./local.sh'
pass_filenames: false
# Prettier (format code, only for non common files)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
stages: [manual]
exclude_types:
- executable
- binary
- shell
- markdown
# Check format of yaml files
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args:
- --no-warnings
- -d
- '{extends: relaxed, rules: {line-length: {max: 120}}}'
# Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args:
- --ignore-words-list=master,als
- --builtin=clear,rare,informal,usage,code,names,en-GB_to_en-US
exclude_types: [image]
exclude: ^docs/man/.*$
# Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
args: [-W, '100']
# Run tests
- repo: local
hooks:
- id: tests
stages: [manual]
name: Run tests
language: system
entry: bash -c "./bash_unit tests/*"
pass_filenames: false
# This is how one can use bash_unit with pre-commit
# Only for documentation purpose as it can't be
# used in bash_unit itself: we always want to test
# bash_unit with the last version of bash_unit.
# Otherwise tests would always fail when we introduce
# a new feature.
# - repo: https://github.com/pgrange/bash_unit
# rev: v2.2.0
# hooks:
# - id: bash-unit
# stages: [manual]
# always_run: true
# verbose: true