|
1 | 1 | exclude: | |
2 | 2 | (?x)( |
3 | | - tests/| |
4 | | - version.py| |
5 | | - conftest.py |
| 3 | + .venv/ |
6 | 4 | ) |
7 | | -
|
8 | 5 | repos: |
| 6 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 7 | + rev: v5.0.0 |
| 8 | + hooks: |
| 9 | + - id: check-yaml |
| 10 | + - id: end-of-file-fixer |
| 11 | + exclude_types: [ python ] |
| 12 | + - id: trailing-whitespace |
| 13 | + exclude_types: [ python ] |
9 | 14 | - repo: https://github.com/astral-sh/ruff-pre-commit |
10 | | - # Ruff version. |
11 | | - rev: v0.9.1 |
| 15 | + rev: v0.9.10 |
12 | 16 | hooks: |
13 | | - # Run the linter. |
14 | 17 | - id: ruff |
15 | | - args: [ --fix ] |
16 | | - # Run the formatter. |
| 18 | + exclude: ^tests/ |
| 19 | + args: [ |
| 20 | + --fix, |
| 21 | + --line-length=100, |
| 22 | + --select=PL, # All Pylint rules |
| 23 | + --select=A001, # Shadowing Python builtins |
| 24 | + --select=ARG, # Unused function arguments |
| 25 | + --select=B, # Bugbear rules (B002,B006,etc) |
| 26 | + --select=BLE, # Blind except |
| 27 | + --select=C, # Complexity |
| 28 | + --select=COM, # Comma placement |
| 29 | + --select=E, # pycodestyle errors |
| 30 | + --select=F, # Pyflakes |
| 31 | + --select=G, # Logging format |
| 32 | + --select=I, # Import ordering |
| 33 | + --select=ISC, # Implicit string concatenation |
| 34 | + --select=N, # Naming |
| 35 | + --select=PIE, # Misc rules |
| 36 | + --select=Q, # Quotes |
| 37 | + --select=RET, # Return statement |
| 38 | + --select=S, # Security |
| 39 | + --select=SIM, # Code simplification |
| 40 | + --select=SLF, # Private member access |
| 41 | + --select=TID, # Tidy imports |
| 42 | + --select=TRY, # Exception handling |
| 43 | + --select=UP, # Upgrade syntax |
| 44 | + --select=W, # Warnings |
| 45 | + '--ignore=B019,S101,G004,TRY003,TRY300,TRY301,TRY400' # Ignore docstring and `assert` detection |
| 46 | + ] |
| 47 | + - id: ruff |
| 48 | + name: ruff-format-tests |
| 49 | + files: ^tests/ |
| 50 | + args: [ |
| 51 | + --fix-only, |
| 52 | + --line-length=99, |
| 53 | + --exit-zero # Don't fail on issues |
| 54 | + ] |
17 | 55 | - id: ruff-format |
18 | | - - repo: https://github.com/RobertCraigie/pyright-python |
19 | | - rev: v1.1.391 |
| 56 | + args: [ |
| 57 | + --line-length=100 |
| 58 | + ] |
| 59 | + - repo: local |
20 | 60 | hooks: |
21 | | - - id: pyright |
22 | | - |
23 | | -# - repo: local |
24 | | -# hooks: |
25 | | -# - id: mypy |
26 | | -# name: MyPy |
27 | | -# entry: | |
28 | | -# mypy |
29 | | -# --ignore-missing-imports |
30 | | -# --install-types |
31 | | -# --non-interactive |
32 | | -# --strict |
33 | | -# --implicit-reexport |
34 | | -# --warn-unused-ignores |
35 | | -# --cache-fine-grained |
36 | | -# --no-namespace-packages |
37 | | -# files: \.py$ |
38 | | -# language: python |
39 | | -# |
40 | | -# - id: pylint |
41 | | -# name: Pylint |
42 | | -# entry: | |
43 | | -# bash -c 'PYTHONPATH=. pylint \ |
44 | | -# --max-line-length=99 \ |
45 | | -# --ignore-imports=yes \ |
46 | | -# "$@"' -- |
47 | | -# files: \.py$ |
48 | | -# language: python |
| 61 | + - id: mypy |
| 62 | + name: mypy |
| 63 | + entry: mypy |
| 64 | + args: [ |
| 65 | + "--install-types", |
| 66 | + "--non-interactive", |
| 67 | + "--ignore-missing-imports", |
| 68 | + "--namespace-packages", |
| 69 | + "--explicit-package-bases" |
| 70 | + ] |
| 71 | + language: system |
| 72 | + types: [ python ] |
0 commit comments