-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
169 lines (168 loc) · 5.25 KB
/
.pre-commit-config.yaml
File metadata and controls
169 lines (168 loc) · 5.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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
- id: sort-simple-yaml
- id: check-yaml
exclude: |
(?x)^(
meta.yaml
)$
- id: check-xml
- id: check-toml
- id: check-docstring-first
- id: check-json
- id: fix-encoding-pragma
- id: detect-private-key
- id: trailing-whitespace
exclude: ^massgen/tests/frontend/__snapshots__/.*\.svg$
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile=black]
- repo: https://github.com/pycqa/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args: [--in-place, --remove-all-unused-imports, --remove-unused-variables]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [--line-length=200]
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [--max-line-length=200, --extend-ignore=E203]
exclude: ^docs
# - repo: https://github.com/pylint-dev/pylint
# rev: v3.0.2
# hooks:
# - id: pylint
# files: ^massgen/backend/
# exclude: |
# (?x)(
# ^docs
# | \.md$
# | \.html$
# | ^examples
# )
# args: [
# --max-line-length=200,
# --disable=W0511,
# --disable=W0718,
# --disable=W0122,
# --disable=C0103,
# --disable=C0302,
# --disable=R0913,
# --disable=E0401,
# --disable=E1101,
# --disable=C0415,
# --disable=W0603,
# --disable=W0613,
# --disable=R1705,
# --disable=R1723,
# --disable=R0914,
# --disable=E0601,
# --disable=W0602,
# --disable=W0604,
# --disable=R0801,
# --disable=R0902,
# --disable=R0903,
# --disable=R0912,
# --disable=C0123,
# --disable=W0231,
# --disable=W1113,
# --disable=W0221,
# --disable=R0401,
# --disable=W0632,
# --disable=W0123,
# --disable=C3001
# ]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.7.0
# hooks:
# - id: mypy
# exclude:
# (?x)(
# ^docs
# | \.html$
# )
# args: [ --disallow-untyped-defs,
# --disallow-incomplete-defs,
# --ignore-missing-imports,
# --disable-error-code=var-annotated,
# --disable-error-code=union-attr,
# --disable-error-code=assignment,
# --disable-error-code=attr-defined,
# --disable-error-code=import-untyped,
# --disable-error-code=truthy-function,
# --disable-error-code=typeddict-item,
# --follow-imports=skip,
# --explicit-package-bases,
# massgen/backend
# ]
- repo: https://github.com/regebro/pyroma
rev: "4.0"
hooks:
- id: pyroma
args: [.]
- repo: local
hooks:
- id: run-non-api-tests-on-push
name: Run non-API test lane before push
entry: sh -c 'uv run pytest massgen/tests --run-integration -m "not live_api and not docker and not expensive" -q --tb=no'
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: sync-agent-instructions
name: Keep CLAUDE.md and AGENTS.md synchronized
entry: python scripts/precommit_sync_agent_instructions.py
language: system
files: ^(CLAUDE|AGENTS)\.md$
pass_filenames: false
# Need to fix locally
# - id: validate-configs
# name: Validate MassGen configuration files
# entry: python scripts/precommit_validate_configs.py
# language: system
# files: ^massgen/configs/.*\.(yaml|yml)$
# exclude: ^massgen/configs/rate_limits/
# pass_filenames: true
- id: sync-readme-pypi
name: Auto-sync README_PYPI.md when README.md changes
entry: python scripts/precommit_sync_readme.py
language: system
files: ^README\.md$
pass_filenames: false
- id: check-package-name
name: Ensure package name is "massgen" in pyproject.toml
entry: python scripts/precommit_check_package_name.py
language: system
files: ^pyproject\.toml$
pass_filenames: false
# - repo: local
# hooks:
# - id: check-massgen-python-file-length
# name: Check massgen Python file length (max 700 lines)
# entry: >
# sh -c 'for file in "$@"; do
# if echo "$file" | grep -q "^massgen/"; then
# lines=$(wc -l < "$file");
# if [ "$lines" -gt 700 ]; then
# echo "Error: $file has $lines lines (max 700 allowed for massgen files)";
# exit 1;
# fi;
# fi;
# done' --
# language: system
# files: ^massgen/.*\.py$
# pass_filenames: true