generated from dynatrace-oss/template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
160 lines (157 loc) · 4.76 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
repos:
# general pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# license checks
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: add license headers (javascript)
files: (?<!.d)\.m?[jt]sx?$
args:
[
--use-current-year,
--license-filepath,
LICENSE_HEADER.txt,
--comment-style,
"//",
]
- id: insert-license
name: add license headers (css)
files: \.css?$
args:
[
--use-current-year,
--license-filepath,
LICENSE_HEADER.txt,
--comment-style,
"/*| *| */",
]
- id: insert-license
name: add license headers (html)
files: \.html??$
args:
[
--use-current-year,
--license-filepath,
LICENSE_HEADER.txt,
--comment-style,
"<!--| ~| -->",
]
- id: insert-license
name: add license headers (python)
files: (?<!__init__)\.py$
args:
[
--use-current-year,
--license-filepath,
LICENSE_HEADER.txt,
--comment-style,
"#",
]
# python files
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: sort imports with isort
args: ["--settings-path", "./src/honeyback/pyproject.toml"]
files: ^src\/(honeyback|honeypatch)\/.*\.py$
- repo: https://github.com/ambv/black
rev: 24.4.2
hooks:
- id: black
name: format files with black
args: ["--config", "./src/honeyback/pyproject.toml"]
files: ^src\/(honeyback|honeypatch)\/.*\.py$
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8
name: lint files with flake8 (honeyquest)
args: ["--config", "./src/honeyback/tox.ini"]
files: ^src\/honeyback\/.*\.py$
additional_dependencies:
- flake8-docstrings
- flake8-rst-docstrings
- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8
name: lint files with flake8 (honeypatch)
args: ["--config", "./src/honeypatch/tox.ini"]
files: ^src\/honeypatch\/.*\.py$
additional_dependencies:
- flake8-docstrings
- flake8-rst-docstrings
- repo: local
hooks:
- id: pylint
name: lint files with pylint (honeyback)
entry: poetry run -C ./src/honeyback pylint --rcfile ./src/honeyback/pyproject.toml -sn -rn
language: system
files: ^src\/honeyback\/.*\.py$
- repo: local
hooks:
- id: pylint
name: lint files with pylint (honeypatch)
entry: poetry run -C ./src/honeypatch pylint --rcfile ./src/honeypatch/pyproject.toml -sn -rn
language: system
files: ^src\/honeypatch\/.*\.py$
- repo: local
hooks:
- id: mypy
name: check types with mypy (honeyback)
entry: poetry run -C ./src/honeyback mypy --config-file ./src/honeyback/pyproject.toml ./src/honeyback
language: system
pass_filenames: false
files: ^src\/honeyback\/.*\.py$
- repo: local
hooks:
- id: mypy
name: check types with mypy (honeypatch)
entry: poetry run -C ./src/honeypatch mypy --config-file ./src/honeypatch/pyproject.toml ./src/honeypatch/honeypatch ./src/honeypatch/tests
language: system
pass_filenames: false
files: ^src\/honeypatch\/.*\.py$
- repo: local
hooks:
- id: mypy
name: test with pytest (honeypatch)
entry: poetry run -C ./src/honeypatch pytest -v --cov=honeypatch ./src/honeypatch
language: system
pass_filenames: false
files: ^src\/honeypatch\/.*\.py$
# javascript files
- repo: local
hooks:
- id: prettier
name: format files with prettier
entry: npm run --prefix ./src/honeyfront format
language: system
pass_filenames: false
files: ^src\/honeyfront\/
- repo: local
hooks:
- id: eslint
name: lint files with eslint
entry: npm run --prefix ./src/honeyfront lint
language: system
pass_filenames: false
files: ^src\/honeyfront\/