-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
123 lines (108 loc) · 3.44 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
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for a list of all hooks
repos:
### GENERAL ###
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.10.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-symlinks
- id: check-json
exclude: ".devcontainer/devcontainer.json"
- id: check-toml
- id: check-xml
- id: mixed-line-ending
- id: trailing-whitespace
exclude: &generated_pages_exclude | # sync with .prettierignore!
(?x)^(
README.md|
SECURITY.md
)$
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
exclude: |
(?x)^(
.cruft.json|
)$
# opinionated code formatter for all things frontend (also includes Markdown, JSON, YAML)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
hooks:
- id: yamllint
args: [-c=.yamllint]
### PYTHON ###
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: [] # as per requirements.txt
# the uncompromising (opinionated / barely configurable) PEP8 Python code formatter.
- repo: https://github.com/psf/black
rev: "23.12.1"
hooks:
- id: black
# isort alternative
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py37-plus, --add-import, "from __future__ import annotations"]
# formats docstrings to follow PEP 257.
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [--in-place]
# flake8 is a python tool that glues together…
# pycodestyle (befriended with `black` through config changes),
# pyflakes (detects various error by parsing [not importing] source file's),
# mccabe (https://en.wikipedia.org/wiki/Cyclomatic_complexity checker) and
# some third-party plugins
# …to check the style and quality of python code.
- repo: https://github.com/pycqa/flake8
rev: "6.1.0"
hooks:
- id: flake8
default_language_version:
python: python3
ci:
autoupdate_schedule: quarterly
autofix_commit_msg: |
chore(pre-commit): auto fixes from hooks :rotating_light:
for more information, see https://pre-commit.ci
autoupdate_commit_msg: |
chore(pre-commit): autoupdate :arrow_up:
TIP: you can trigger a re-run on a pull request by commenting `pre-commit.ci run` (must appear on a line by itself)
exclude: ".idea"