latent.lint.rules.lt018¶
LT018 — An explicit empty gates — an off switch spelled like an empty slot.
Functions¶
lt018¶
An explicit empty gates — an off switch spelled like an empty slot.
resolve_gates takes an explicit argument verbatim, {} included, and
only None means "resolve this flow's thresholds.yaml section". So
gates={} reads as "nothing configured yet" and is "gate nothing":
every threshold in the lockfile is skipped and the run passes. The two
spellings differ by one keyword, and only one of them is ever what the
author meant.
Three binding forms, because the coercion that defeats the obvious fix
(gates = gates or {} a layer below the call) is the same defect at a
different node:
- a
gates=keyword argument, under any callee. The keyword names the gating vocabulary, so it needs no further evidence — and a helper of your own with an unrelatedgates=parameter that legitimately takes{}fires and wants a waiver; resolve_gates({})positionally, which names the resolver itself;- a bare
gates = {}assignment, but only where that very name is handed to the gating machinery somewhere in the module (:func:_gates_reach_gating). Alone, a local calledgatesis as likely an accumulator seeded{}or anoverrides or {}default — correct code with no better spelling.
Deliberately disabling gates is legitimate and waivable; being unable to tell that from an unfinished config is not.