-
Notifications
You must be signed in to change notification settings - Fork 237
/
.pre-commit-config.yaml
80 lines (71 loc) · 3.9 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast # Simply check whether the files parse as valid python
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems
- id: check-builtin-literals # Require literal syntax when initializing empty or zero Python builtin types
- id: check-docstring-first # Checks a common error of defining a docstring after code
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: check-toml # Attempts to load all TOML files to verify syntax
- id: check-yaml # Attempts to load all yaml files to verify syntax
- id: check-vcs-permalinks # Ensures that links to vcs websites are permalinks
- id: debug-statements # Check for debugger imports and py37+ `breakpoint()` calls in python source
- id: detect-private-key # Detects the presence of private keys
- id: double-quote-string-fixer # Replaces double quoted strings with single quoted strings
- id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: trailing-whitespace # This hook trims trailing whitespace
exclude: setup.cfg
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [
flake8-blind-except, # check for blind, catch-all "except:" statements
flake8-bugbear, # find likely bugs and design problems
flake8-builtins, # check for python builtins being used as variables or parameters
flake8-fixme, # check for FIXME, TODO and other temporary developer notes
flake8-markdown, # lint Python code blocks in Markdown files using flake8
flake8-pep3101, # check for old string formatting
flake8-print, # check for print statements
flake8-use-fstring, # enforce use of f-string
flake8-2020, # check for misuse of `sys.version` or `sys.version_info`
pep8-naming, # check PEP-8 naming conventions
]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa # enforce that noqa annotations always occur with specific codes
- id: python-check-blanket-type-ignore # enforce that # type: ignore annotations always occur with specific codes
- id: python-no-log-warn # check for the deprecated .warn() method of python loggers
- id: python-use-type-annotations # enforce that type annotations are used instead of type comments
- id: rst-backticks # detect common mistake of using single backticks when writing rst
- id: rst-directive-colons # detect mistake of rst directive not ending with double colon
- id: rst-inline-touching-normal # detect mistake of inline code touching normal text in rst
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
hooks:
- id: pyupgrade
args: ['--py38-plus', '--keep-runtime-typing']
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
args: ['--include-version-classifiers']
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
hooks:
- id: doc8
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
ci:
autoupdate_commit_msg: Autoupdate pre-commit hooks