Commit graph

1 commit

Author SHA1 Message Date
mateo-berri
a7f0b9b982
feat(lint): gate coarse object typing alongside Any (LIT010)
The any-discipline gate flagged values whose inferred type contains Any but let
`object` slip through: a `dict[str, object]` hands back an unnarrowable value on
every read, yet nothing caught it. This extends the same gate to a second
discipline. A value whose inferred type is, or contains, `object` now trips
LIT010, budgeted per file in its own `object-discipline-budget.json` so the
existing tree is grandfathered (324 files, 2109 values, 50% headroom) and only
new coarse `object` in an otherwise-clean file fails. A genuine boundary line is
suppressed with `# object-ok: <reason>`, the same shape as `# any-ok`

A bare `object` at an untyped boundary (a `def f(x: object)` you immediately
narrow) is the disciplined alternative to `Any`, so it is grandfathered by the
budget rather than carved out in code

The leaf predicate, AST walk, suppression scan, and per-file budget are now
shared across both disciplines, and `budget_ratchet_check.py` guards the new
budget file with the same zero-floor semantics as the Any budget
2026-06-17 13:49:16 +00:00