-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
156 lines (147 loc) · 4.72 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
# using default_language_version
default_language_version:
node: 16.14.2
repos:
# -------------------------- Version control checks -------------------------- #
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
name: Check for merge conflicts
- id: check-vcs-permalinks
name: Ensure links to VCS websites are permalinks
- id: detect-private-key
name: Detect private key
- id: check-case-conflict
name: Check issues with file name casing
- id: check-symlinks
name: Check for symlinks which point to nothing
- id: destroyed-symlinks
name: Check for destroyed symlinks
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.27.2
hooks:
- id: check-github-workflows
name: Validate GitHub workflows
types: [yaml]
# --------------------------- Commit message check --------------------------- #
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.0.0
hooks:
- id: conventional-pre-commit
name: Check commit message follows Conventional Commits
stages: [commit-msg]
# ----------------------------- Check file issues ---------------------------- #
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-toml
name: Check TOML
types: [toml]
- id: check-yaml
name: Check YAML
args: [--allow-multiple-documents]
types: [yaml]
- id: end-of-file-fixer
name: Fix end of files
types: [text]
- id: trailing-whitespace
name: Trim trailing whitespace
args: [--markdown-linebreak-ext=md]
types: [text]
- id: mixed-line-ending
name: Check line endings
- id: fix-encoding-pragma
name: Remove any encoding pragma
args: [--remove]
# ------------------------------ Python checking ----------------------------- #
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: debug-statements
name: Check for debugger statements
types: [python]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-use-type-annotations
name: Using type annotations over comments
types: [python]
- id: python-check-blanket-noqa
name: Check for blanket `# noqa`
types: [python]
- id: python-check-blanket-type-ignore
name: "Check for blanket `# type: ignore`"
types: [python]
- id: python-no-log-warn
name: Check for deprecated `.warn()` method of python loggers
types: [python]
# ----------------------------- Automatic linters ---------------------------- #
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
name: Update syntax for newer Python
types: [python]
args: ["--py39-plus"]
- repo: https://github.com/sirosen/texthooks
rev: 0.6.3
hooks:
- id: fix-smartquotes
name: Fix Smart Quotes
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
name: Remove unnecessary `# noqa` comments
types: [python]
additional_dependencies: [wemake-python-styleguide]
# ------------------------------ Python imports ------------------------------ #
- repo: https://github.com/hakancelik96/unimport
rev: 1.1.0
hooks:
- id: unimport
name: Remove any unused imports
types: [python]
args:
[
--remove,
--exclude,
'^.*/?__init__\.py$',
--include-star-import,
--gitignore,
]
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
types: [python]
name: Convert relative imports to absolute
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
name: Format imports
additional_dependencies: [toml]
types: [python]
exclude: ^.*/?setup\.py$
# -------------------------------- Formatting -------------------------------- #
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
name: Prettier
exclude: ^.*/?CHANGELOG\.md$
- repo: https://github.com/myint/docformatter
rev: v1.7.5
hooks:
- id: docformatter
name: Format docstrings
types: [python]
args: [--in-place, --wrap-summaries=99, --wrap-descriptions=99]
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black-jupyter
types: [python]
name: Format code