-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
92 lines (82 loc) · 2.35 KB
/
.pre-commit-config.yaml
File metadata and controls
92 lines (82 loc) · 2.35 KB
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
repos:
# Python code formatting
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
language_version: python3
args: [--line-length=88]
# Import sorting
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile=black, --line-length=88]
# Code style checking
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args: [--max-line-length=88, --extend-ignore=E203,W503]
additional_dependencies:
- flake8-docstrings
- flake8-bugbear
- flake8-comprehensions
# Security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: [-r, agb/, -ll]
exclude: tests/
# Trailing whitespace and end of file fixes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: \.md$
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-merge-conflict
- id: debug-statements
- id: check-docstring-first
# Python specific checks
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-no-log-warn
- id: python-use-type-annotations
# Type checking (optional, may be slow)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
args: [--ignore-missing-imports, --show-error-codes]
additional_dependencies: [types-requests, types-setuptools]
exclude: tests/
# Check requirements.txt format
- repo: https://github.com/pre-commit/mirrors-pip-compile
rev: v7.4.1
hooks:
- id: pip-compile
files: requirements/.*\.in$
args: [--quiet, --strip-extras]
# Global configuration
default_language_version:
python: python3.11
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false