devops.cpp.ast.registry
Registry of active AST checks.
Add a new check here after implementing it as a Check subclass under devops.cpp.ast.checks.
Functions
|
Apply per-check configuration and return a new list of checks. |
|
Filter checks by id using an optional allow/deny list. |
- devops.cpp.ast.registry.select_checks(checks, *, enabled_ids=None, disabled_ids=None)[source]
Filter checks by id using an optional allow/deny list.
An empty (or omitted) enabled_ids means “no allowlist restriction” — every check runs except those in disabled_ids. A non-empty enabled_ids acts as an allowlist: only those checks run, and disabled_ids is still subtracted from that set.
- Parameters:
- Returns:
list[Check] – The filtered list of checks.
- Raises:
ConfigError – If any id in enabled_ids/disabled_ids matches no known check — typically a typo, or a check id that only exists in a newer devops version than the one actually installed.
- Return type:
- devops.cpp.ast.registry.configure_checks(checks, check_config=None)[source]
Apply per-check configuration and return a new list of checks.
Each check whose .id appears in check_config receives a shallow copy so that the shared ALL_CHECKS singletons are never mutated. The generic
exclude_pathskey (path patterns of files the check must not run on) is handled here for every check; the rest of the table goes to the check’s ownconfigure().- Parameters:
- Returns:
list[Check] – A new list where configured checks are shallow-copied instances.
- Return type: