#!/usr/bin/env python3 """Limits gate of lawbook chapter 301 (LeaseVibe STRA-367): function length, complexity, nesting and line width. diff every function that is added or has a changed line, and every added or changed line, must be within the limits of limits.json (function 30 lines, complexity 10, nesting 4, width 120 columns) unless limits-allowlist.json lists the function with a reason and an owner; an allowlisted function may only shrink. census the legacy that exists today is counted per crate in limits-baseline.json; a total may only fall. Stdlib Python, no network, no GPU. Usage: scripts/check-limits.py [--base REF] [--update-baseline [--allow-increase]] [--allowlist-add --reason R --owner K] [--skip-diff] [--skip-census] [--report] """ import pathlib import sys sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) from limits.cli import main # noqa: E402 if __name__ == "__main__": sys.exit(main(sys.argv[1:], pathlib.Path(__file__).resolve().parent.parent))