-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent-precommit.toml
More file actions
81 lines (68 loc) · 2.21 KB
/
agent-precommit.toml
File metadata and controls
81 lines (68 loc) · 2.21 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
# agent-precommit configuration for the agent-precommit project itself
# This serves as both a working example and dogfooding our own tool
[detection]
# Additional environment variables that indicate an agent
agent_env_vars = []
[integration]
# We use pre-commit framework for base checks
pre_commit = true
pre_commit_path = ".pre-commit-config.yaml"
[human]
# Human mode: fast checks for quick iteration
checks = ["pre-commit"]
timeout = "30s"
fail_fast = true
[agent]
# Agent mode: thorough checks for merge-ready commits
checks = [
"pre-commit-all",
"no-merge-conflicts",
"fmt-check",
"clippy",
"test-unit",
"build-verify",
]
timeout = "15m"
fail_fast = false
# Run in parallel where possible
parallel_groups = [
["pre-commit-all", "no-merge-conflicts"],
["fmt-check", "clippy"],
["test-unit"],
["build-verify"],
]
# =============================================================================
# Check Definitions
# =============================================================================
[checks.pre-commit]
run = "pre-commit run"
description = "Run pre-commit on staged files"
[checks.pre-commit-all]
run = "pre-commit run --all-files"
description = "Run pre-commit on all files"
[checks.no-merge-conflicts]
run = """
git fetch origin main --quiet 2>/dev/null || git fetch origin master --quiet 2>/dev/null || true
MAIN_BRANCH=$(git rev-parse --verify origin/main 2>/dev/null && echo "main" || echo "master")
BASE=$(git merge-base HEAD origin/$MAIN_BRANCH 2>/dev/null || echo "")
if [ -n "$BASE" ]; then
if git merge-tree $BASE HEAD origin/$MAIN_BRANCH 2>/dev/null | grep -q "^<<<<<<<"; then
echo "❌ Would conflict with $MAIN_BRANCH"
exit 1
fi
fi
echo "✓ No conflicts with main branch"
"""
description = "Check for merge conflicts with main/master"
[checks.fmt-check]
run = "cargo fmt --all -- --check"
description = "Check Rust code formatting"
[checks.clippy]
run = "cargo clippy --all-targets --all-features -- -D warnings"
description = "Run Clippy lints with strict warnings"
[checks.test-unit]
run = "cargo test --all-features"
description = "Run all unit tests"
[checks.build-verify]
run = "cargo build --release"
description = "Verify release build succeeds"