-
Notifications
You must be signed in to change notification settings - Fork 44
/
.pre-commit-config.yaml
131 lines (124 loc) · 4.03 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
default_language_version:
python: python3.6
repos:
- repo: https://github.com/psf/black
# NOTE: Newer version does no longer support python3.6
rev: 22.8.0
hooks:
- id: black
name: Formatting Python
- id: black
# We want this hook to be part of "pylint" so that if we run
# `pre-commit run pylint` we include this hook
alias: pylint
name: Checking Python formatting
args:
- --check
- --diff
- repo: https://github.com/pycqa/pylint
# NOTE: Newer version does no longer support python3.6
rev: v2.13.9
hooks:
- id: pylint
name: Lint Python (non-salt)
# Linting for non-salt files (buildchain and python not executed
# by salt directly)
additional_dependencies:
- 'pyenchant~=3.2'
- 'doit~=0.32.0'
- 'docker~=4.1.0'
- 'PyYAML~=5.3.1'
- 'pytest~=5.4'
- 'Click~=8.0'
- 'treelib~=1.6'
files: >
(?x)^(
buildchain/dodo\.py|
buildchain/buildchain/.*\.py|
packages/debian/common/download_packages\.py|
salt/metalk8s/volumes/files/sparse_volume_cleanup\.py|
tools/lib-alert-tree/.*\.py
)$
- id: pylint
name: Lint Salt
# Linting for salt files only in directory "salt/_<module>/<module_name>.py"
files: salt/_.*/.*\.py
additional_dependencies: ['saltpylint==2023.8.3', 'six==1.15.0']
args:
- --rcfile=salt/.pylintrc
- id: pylint
name: Lint Salt Formulas tests
files: salt/tests/unit/formulas/.*\.py
additional_dependencies:
- 'pyenchant~=3.2'
- 'salt==3002.9'
- pytest
- Jinja2
- id: pylint
name: Lint sos report plugin
# Linting for sos report plugin files only
files: ^packages/common/metalk8s-sosreport/.*\.py$
additional_dependencies:
- requests
args:
- --rcfile=packages/common/metalk8s-sosreport/.pylintrc
# Python 2.7 specific
- repo: https://github.com/pre-commit/mirrors-pylint
# NOTE: Newer version does no longer support python2.7
rev: v1.9.1
hooks:
- id: pylint
name: Lint sos report plugin (python2.7)
language_version: python2.7
# Linting for sos report plugin files only
files: ^packages/common/metalk8s-sosreport/.*\.py$
additional_dependencies:
- requests
args:
- --rcfile=packages/common/metalk8s-sosreport/.pylintrc
- repo: https://github.com/pre-commit/mirrors-mypy
# NOTE: Newer version does no longer support python3.6
rev: v0.931
hooks:
- id: mypy
# We want this hook to be part of "pylint" so that if we run
# `pre-commit run pylint` we include this hook
alias: pylint
name: Python typing (buildchain)
additional_dependencies:
- 'types-PyYAML~=5.4'
# Only check typing for typed files
files: >
(?x)^(
buildchain/dodo.py|
buildchain/buildchain/.*|
packages/debian/common/download_packages.py
)$
args:
- --strict
- id: mypy
# We want this hook to be part of "pylint" so that if we run
# `pre-commit run pylint` we include this hook
alias: pylint
name: Python typing (formulas rendering tests)
files: ^(salt/tests/unit/formulas/.*\.py)$
args: [--strict]
additional_dependencies:
- 'pyenchant~=3.2'
- 'types-PyYAML~=5.4'
- 'types-Jinja2~=2.11'
- pytest
- repo: https://github.com/warpnet/salt-lint
rev: v0.9.2
hooks:
- id: salt-lint
- repo: https://github.com/adrienverge/yamllint.git
# NOTE: Newer version does no longer support python3.6
rev: v1.28.0
hooks:
- id: yamllint
files: >
(?x)^(
salt/metalk8s/defaults.yaml|
salt/tests/unit/formulas/.*\.yaml
)$