-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
201 lines (197 loc) · 5.94 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
201 lines (197 loc) · 5.94 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
skip:
- mypy # Uses language: system, not available in pre-commit.ci sandbox
- protolint-docker # Needs Docker, not available in pre-commit.ci
- hadolint-docker # Needs Docker, not available in pre-commit.ci
- pycln # Path resolution bug in pre-commit.ci sandbox
- end-of-file-fixer # Inconsistent behavior between local and CI environments
- flake8 # Pre-existing violations — will clean up separately
- markdownlint # Pre-existing violations — will clean up separately
- absolufy-imports # Incorrectly rewrites relative imports in monorepo structure
- black # Large-scale reformatting — will clean up in dedicated PR
- pyupgrade # Pre-existing across 43 files
- isort # Pre-existing import ordering across codebase
- yesqa # Pre-existing unnecessary noqa comments
- docformatter # Pre-existing docstring formatting
autofix_prs: false
autoupdate_schedule: monthly
# Force all unspecified python hooks to run python 3.10
default_language_version:
python: python3.10
default_stages:
- commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude_types:
- "markdown"
- "svg"
- id: end-of-file-fixer
exclude_types:
- "svg"
- id: check-yaml
args: [--unsafe]
- id: check-added-large-files
args: ["--maxkb=15240"]
- id: check-case-conflict
- id: check-docstring-first
- id: check-ast
- id: check-json
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: debug-statements
- id: detect-private-key
exclude: sample\.env$
# - id: detect-aws-credentials
# args: ["--allow-missing-credentials"]
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
# - id: fix-encoding-pragma
- id: forbid-new-submodules
- id: mixed-line-ending
# - id: double-quote-string-fixer
# - id: name-tests-test
- id: no-commit-to-branch
args: [--branch, main]
# - id: requirements-txt-fixer
# - id: file-contents-sorter
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
args: [--config=backend/pyproject.toml]
# - id: black
# alias: black-check
# stages: [manual]
# args:
# - "--check"
# - "--diff"
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
entry: pyupgrade --py39-plus --keep-runtime-typing
types:
- python
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args: [--config=backend/pyproject.toml]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
files: "\\.(py)$"
args: [--settings-path=backend/pyproject.toml]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--max-line-length=120]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.3.0
# hooks:
# - id: mypy
# args:
# [
# --show-error-codes,
# --pretty,
# --ignore-missing-imports,
# --check-untyped-defs,
# --implicit-reexport,
# --python-version=3.8,
# --strict,
# --warn-unreachable,
# --warn-return-any,
# --warn-unused-configs,
# ]
# # files: visitran
# language: system
# exclude: tests/unit/data/|cloud/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
name: mypy
entry: mypy
args: ["--config-file", ".mypy.ini"]
# files: visitran
language: system
types: [python]
exclude: tests/unit/data/|cloud/|ci/
- repo: https://github.com/yoheimuta/protolint
rev: v0.47.5
hooks:
- id: protolint-docker
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: "v9.0.0-alpha.2" # Use the sha / tag you want to point at
# hooks:
# - id: eslint
# args: []
# files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
# types: [file]
# additional_dependencies:
# - eslint@8.41.0
# - eslint-config-google@0.14.0
# - eslint-config-prettier@8.8.0
# - eslint-plugin-prettier@4.2.1
# - eslint-plugin-react@7.32.2
# - eslint-plugin-import@2.25.2
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint
args: ["--config", "markdownlint.yaml"]
- repo: https://github.com/pycqa/docformatter
rev: v1.7.7
hooks:
- id: docformatter
- repo: https://github.com/adrienverge/yamllint
rev: v1.34.0
hooks:
- id: yamllint
args: ["--config-file", "yamllint.yaml"]
- repo: https://github.com/rhysd/actionlint
rev: v1.6.26
hooks:
- id: actionlint
args: ["--config-file", "actionlint.yaml"]
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
args:
- --ignore=DL3003
- --ignore=DL3008
- --ignore=DL3013
- --ignore=DL3018
- --ignore=SC1091
files: Dockerfile$