-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
72 lines (72 loc) · 2.15 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
exclude: |
(?x)(
.venv/
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude_types: [ python ]
- id: trailing-whitespace
exclude_types: [ python ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.7
hooks:
- id: ruff
exclude: ^tests/
args: [
--fix,
--line-length=100,
--select=PL, # All Pylint rules
--select=A001, # Shadowing Python builtins
--select=ARG, # Unused function arguments
--select=B, # Bugbear rules (B002,B006,etc)
--select=BLE, # Blind except
--select=C, # Complexity
--select=COM, # Comma placement
--select=E, # pycodestyle errors
--select=F, # Pyflakes
--select=G, # Logging format
--select=I, # Import ordering
--select=ISC, # Implicit string concatenation
--select=N, # Naming
--select=PIE, # Misc rules
--select=Q, # Quotes
--select=RET, # Return statement
--select=S, # Security
--select=SIM, # Code simplification
--select=SLF, # Private member access
--select=TID, # Tidy imports
--select=TRY, # Exception handling
--select=UP, # Upgrade syntax
--select=W, # Warnings
'--ignore=B019,S101,G004,TRY003,TRY300,TRY301,TRY400' # Ignore docstring and `assert` detection
]
- id: ruff
name: ruff-format-tests
files: ^tests/
args: [
--fix,
--line-length=99,
--exit-zero # Don't fail on issues
]
- id: ruff-format
args: [
--line-length=100
]
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy
args: [
"--install-types",
"--non-interactive",
"--ignore-missing-imports",
"--namespace-packages",
"--explicit-package-bases"
]
language: system
types: [ python ]