-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
56 lines (53 loc) · 1.93 KB
/
.pre-commit-config.yaml
File metadata and controls
56 lines (53 loc) · 1.93 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
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [--fix]
exclude: plugins/forgesyte-yolo-tracker/tests_heavy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
exclude: plugins/forgesyte-yolo-tracker/tests_heavy
- repo: local
hooks:
- id: validate-yolo-manifest
name: Validate YOLO manifest
entry: uv run validate_manifest.py plugins/forgesyte-yolo-tracker/src/forgesyte_yolo_tracker/manifest.json
language: system
files: manifest\.json$
pass_filenames: false
stages: [commit]
- id: enforce-plugin-structure
name: Enforce canonical plugin structure
entry: bash
args:
- -c
- |
echo "Checking for duplicate plugin package roots..."
FAILED=0
for plugin_dir in plugins/*/; do
plugin_name=$(basename "$plugin_dir")
if [ -d "$plugin_dir/$plugin_name" ]; then
echo "❌ ERROR: Forbidden structure in $plugin_name/"
echo " Source code found at plugins/$plugin_name/$plugin_name/"
echo " Must use: plugins/$plugin_name/src/$plugin_name/"
FAILED=1
fi
if [ -d "$plugin_dir/src/src" ]; then
echo "❌ ERROR: Duplicate src/ in $plugin_name/"
echo " Found: plugins/$plugin_name/src/src/"
FAILED=1
fi
done
if [ "$FAILED" -eq 1 ]; then
echo ""
echo "Fix the plugin structure before committing."
exit 1
fi
echo "✓ Plugin structure check passed."
exit 0
language: system
pass_filenames: false
stages: [commit]