* BEGUILD-37: Ratchet dynamic vars with a kondo linter
Add :metabase/discourage-dynamic-vars to the def hook. It flags a def,
defonce, defn, or defn- whose name has ^:dynamic or ^{:dynamic true}
metadata. The finding sits on the whole form, so an ignore above a
multi-line def suppresses it.
The 382 existing dynamic vars get inline ignores, and ratchets.edn
seeds a budget of 382. The linter is comment-exempt because the
inserted ignores have no explanatory comments. The shrink workflow
lowers the budget as dynamic vars are removed.
* BEGUILD-37: Flag dynamic mu/defn too
Kondo lints mu/defn as schema.core/defn, so the def hook never saw it.
Add a lint-dynamic hook for mu/defn and mu/defn- that runs only the
dynamic-var check. Ignore the 13 existing sites and raise the budget
to 395.
Also remove three ignores in dev and mage that sat inside the form,
where they did nothing.
* Whitespace
* BEGUILD-37: Close review gaps in the dynamic var linter
Flag a defn whose attr-map has {:dynamic true}. Clojure merges the
attr-map into the var metadata, so that form makes a dynamic var too.
Register lint-dynamic for cljs.core def, defn, defn-, and defonce.
In cljs code, def resolves to these, so no hook ran before.
Test the routing through the real config with kondo/run!, so removing
a registration from config.edn fails a test.
Correct two comments. An ignore above a form covers every line of the
form. The problem was that kondo-insert-ignores puts the ignore on the
line above the finding.