forked from antonioterpin/synthpix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
120 lines (108 loc) · 3.35 KB
/
.pre-commit-config.yaml
File metadata and controls
120 lines (108 loc) · 3.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
exclude: ^(tests/|scripts/|examples/)
repos:
# Python dependencies
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.21
hooks:
- id: uv-lock
# Python code formatting with autopep8
- repo: https://github.com/hhatto/autopep8
rev: v2.3.2
hooks:
- id: autopep8
# Import sorting with isort
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
hooks:
- id: isort
# Python linting with flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
# Type checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies: [
types-tqdm,
types-PyYAML,
types-setuptools,
types-requests,
]
# Google-style docstring checking
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies: [tomli]
# Security scanning with bandit
- repo: https://github.com/PyCQA/bandit
rev: 1.9.2
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]", "pbr"]
# YAML/JSON/TOML formatting and validation
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
args: ["--unsafe"] # Allow custom YAML tags
- id: check-json
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-case-conflict
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-docstring-first
- id: debug-statements
- id: name-tests-test
args: ["--pytest-test-first"]
# Check for Python import cycles and unused imports (auto-fixes)
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- --remove-all-unused-imports
- --remove-unused-variables
- --in-place
- --recursive
# Conventional commit message validation
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.3.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
# Check for proper snake_case/PascalCase naming conventions
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-no-log-warn
- id: python-no-eval
- id: python-use-type-annotations
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
# # Custom hooks for project-specific requirements
# - repo: local
# hooks:
# # Check single return statement pattern
# - id: check-single-return
# name: Check single return statements
# entry: python scripts/custom.py
# language: python
# files: \.py$
# exclude: ^(tests/|__pycache__/|\.venv/)
# additional_dependencies: []
# Spell checking for documentation
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: typos
args: ["--format", "brief"]
exclude: ^(\.git/|\.venv/|build/|dist/)