-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
80 lines (75 loc) · 2.25 KB
/
.pre-commit-config.yaml
File metadata and controls
80 lines (75 loc) · 2.25 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
# Pre-commit hooks configuration for HHW Brick
# See https://pre-commit.com for more information
default_language_version:
python: python3.10
# Global exclude pattern - applies to ALL hooks
exclude: |
(?x)^(
.*\.egg-info/.*|
\.git/.*|
\.pytest_cache/.*|
__pycache__/.*|
htmlcov/.*|
\.coverage.*|
build/.*|
dist/.*|
\.tox/.*|
\.venv/.*|
venv/.*|
Env/.*|
\.idea/.*|
\.github/.*|
.*\.ttl|
.*\.csv|
tests/fixtures/.*|
examples/.*\.py|
scripts/.*\.py|
架构分析与修复总结_CN\.md|
fix_bom\.py|
remove_bom\.py|
test_migration\.py|
quick_start\.py|
setup_precommit\.py
)$
repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
exclude: 'mkdocs\.yml' # mkdocs.yml has special syntax
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
args: ['--fix=lf']
# Python code formatting with Black
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3.10
args: ['--line-length=100']
# Python linting with Flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args:
- '--max-line-length=100'
- '--extend-ignore=E203,W503,E501,F541,F401,E722,F841,E402,E401'
# E203: conflicts with black
# W503: line break before binary operator (conflicts with black)
# E501: line too long (handled by black)
# F541: f-string without placeholders (common in logging)
# F401: imported but unused (common in __init__.py)
# E722: bare except (used intentionally in many places)
# F841: local variable assigned but never used (common in development)
# E402: module level import not at top of file (used for conditional imports)
# E401: multiple imports on one line (allowed for readability in some cases)
- '--per-file-ignores=__init__.py:F401,F403'