New and changed code is checked against the base (merge-base with the integration branch): every added or touched function and every added or changed line must be within the limits, unless limits-allowlist.json lists the function with a reason and an owner; an allowlisted function may only shrink. The legacy that exists today is a per-crate census in limits-baseline.json whose totals may only fall (same --update-baseline semantics as the architecture gate). Rust is measured from the rustsplit lexer, the gate's own Python from ast. 56 self-tests, including a temporary git repository.
12 lines
634 B
JSON
12 lines
634 B
JSON
{
|
|
"_comment": "Policy of scripts/check-limits.py (STRA-367, lawbook chapter 301). The limits apply to new and changed code (diff gate) and to the whole tree as a falling census. See docs/architecture/limits-gate.md.",
|
|
"limits": {"fn_lines": 30, "complexity": 10, "nesting": 4, "width": 120},
|
|
"tab_width": 4,
|
|
"exclude": ["engine/strata/", "target/", ".git/"],
|
|
"python_include": [
|
|
"scripts/limits/", "scripts/archcheck/", "scripts/check-limits.py", "scripts/check_limits_test.py",
|
|
"scripts/check-architecture.py", "scripts/check_architecture_test.py"
|
|
],
|
|
"base_candidates": ["claude/hexagonal-integ", "main", "origin/main"]
|
|
}
|