-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
98 lines (91 loc) · 3.75 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
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: CC0-1.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Prevent giant files from being committed
- id: check-added-large-files
# Simply check whether files parse as valid python
- id: check-ast
# Require literal syntax when initializing empty or zero Python builtin types
- id: check-builtin-literals
# Check for files that would conflict in case-insensitive filesystems
- id: check-case-conflict
# Checks for a common error of placing code before the docstring
- id: check-docstring-first
# Ensures that (non-binary) executables have a shebang
- id: check-executables-have-shebangs
# Check for files that contain merge conflict strings
- id: check-merge-conflict
# Checks that scripts with shebangs are executable
- id: check-shebang-scripts-are-executable
# Checks for symlinks which do not point to anything
- id: check-symlinks
# This hook checks yaml files for parseable syntax
- id: check-yaml
# Check for debugger imports and py37+ breakpoint() calls in python source
- id: debug-statements
# Detects the presence of private keys
- id: detect-private-key
# Ensures that a file is either empty, or ends with one newline
- id: end-of-file-fixer
# removes UTF-8 byte order marker
- id: fix-byte-order-marker
# Replaces or checks mixed line ending
- id: mixed-line-ending
# Assert that files in tests/ end in _test.py
- id: name-tests-test
# Protect specific branches from direct checkins
# - id: no-commit-to-branch
# This hook trims trailing whitespace
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
# Enforce that `noqa` annotations always occur with specific codes
- id: python-check-blanket-noqa
# Enforce that # type: ignore annotations always occur with specific codes
- id: python-check-blanket-type-ignore
# Prevent common mistakes of `assert mck.not_called()`, `assert mck.called_once_with(...)` and `mck.assert_called`
- id: python-check-mock-methods
# A quick check for the `eval()` built-in function
- id: python-no-eval
# A quick check for the deprecated `.warn()` method of python loggers
- id: python-no-log-warn
# Enforce that python3.6+ type annotations are used instead of type comments
- id: python-use-type-annotations
# Detect common mistake of using single backticks when writing rst
- id: rst-backticks
# Detect mistake of rst directive not ending with double colon
- id: rst-directive-colons
# Detect mistake of inline code touching normal text in rst
- id: rst-inline-touching-normal
# Forbid files which have a UTF-8 Unicode replacement character
- id: text-unicode-replacement-char
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
args: [--ignore-missing-imports]
exclude: ^(docs/|setup.py)
# Check for missing licensing and copyright information.
# The REUSE helper tool assists with achieving and confirming REUSE compliance.
# See: https://reuse.software/
- repo: https://github.com/fsfe/reuse-tool
rev: v5.0.2
hooks:
- id: reuse
ci:
autofix_commit_msg: |
* - auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: 'ci - pre-commit autoupdate'