-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
162 lines (160 loc) · 4.35 KB
/
.pre-commit-config.yaml
File metadata and controls
162 lines (160 loc) · 4.35 KB
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
161
162
fail_fast: true
default_install_hook_types: [pre-commit, post-commit]
repos:
- repo: https://github.com/andreoliwa/nitpick
rev: "v0.33.2"
hooks:
- id: nitpick
- repo: https://github.com/python-poetry/poetry
rev: 1.5.0
hooks:
- id: poetry-lock
args: ["--check"]
files: "(pyproject.toml|poetry.lock)"
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.9-for-vscode"
hooks:
- id: prettier
stages:
- commit
additional_dependencies:
- prettier
- prettier-plugin-toml
- "@prettier/plugin-xml"
- prettier-plugin-sh
exclude: ^(.idea/.*|CHANGELOG.md|template.yaml)
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 23.3.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
exclude: "[CHANGELOG.md]"
- id: mixed-line-ending
args:
- --fix=auto
- id: pretty-format-json
args:
- --autofix
- --indent=4
- --no-sort-keys
exclude: "[inputs.json|syntax_error.json]"
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-no-log-warn
- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args:
- --config=.config/.flake8
additional_dependencies:
- flake8-bugbear>=19.3.0
- flake8-builtins>=1.4.1
- flake8-commas>=2.0.0
- flake8-comprehensions>=2.1.0
- flake8-debugger>=3.1.0
- flake8-pep3101>=1.2.1
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
additional_dependencies:
- bandit[toml]
args:
- -c
- pyproject.toml
- -f
- custom
- -q
- --msg-template
- "{abspath}:{line}: {test_id}: Severe-{severity}/Conf-{confidence}: {msg}"
- repo: https://github.com/domdfcoding/flake2lint
rev: v0.4.3
hooks:
- id: flake2lint
- repo: https://github.com/mumblepins/dep_checker
rev: v0.7.1
hooks:
- id: dep_checker
args:
- --req-file
- ../pyproject.toml
- -d
- src
- template_python_library
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.4.0"
hooks:
- id: mypy
args: ["--config-file", "pyproject.toml"]
files: '^(src/.*|[^/]*)\.py$'
additional_dependencies:
- types-requests
- pydantic
- html2text
- boto3-stubs
- pytest-stub
- repo: local
hooks:
- id: pylint
name: pylint
entry: >
poetry run
pylint
language: system
types: [python]
args: ["-rn", "-sn", "--extension-pkg-whitelist=pydantic", "--rcfile=.config/.pylintrc"]
- id: pytest-local
name: pytest-local
description: Run pytest in the local virtualenv
stages: [manual]
entry: >
poetry run pytest
-n 4
--dist worksteal
--reruns 3
--verbose
--cov
--cov-report=html --cov-report=term --cov-report=xml
--junitxml=junit.xml
language: system
pass_filenames: false
always_run: true
types: [python]
verbose: true
- repo: local
hooks:
- id: gitchangelog
language: system
always_run: true
pass_filenames: false
name: Generate changelog
entry: poetry run bash -c "GITCHANGELOG_CONFIG_FILENAME='.config/.gitchangelog.rc'
gitchangelog > CHANGELOG.md"
stages: [post-commit]