Skip to main content

Module config

Module config 

Source
Expand description

The testing-conventions config schema and loader.

One config file is read into the in-memory Config below. The loader parses and validates the config itself (the “self-guard” from issue #12): a malformed or unknown-key config is an error, never a silently-accepted default. Validation also covers the per-file Exemption list (issue #32): every exemption must name at least one rule and carry a non-empty reason.

Structs§

Config
A fully-parsed testing-conventions config file.
Exemption
One auditable per-file exemption — a [[<language>.exempt]] entry.
PythonConfig
The [python] table. Both keys are optional, so a repo can configure just coverage, just exemptions, or both. Default (no coverage table, no exemptions) backs the zero-config path: an absent [python] table means the rule runs against the default floor with nothing exempt (#80).
PythonCoverage
[python].coverage. A partial override#[serde(default)] fills any missing field from PythonCoverage::default, so a table that sets only one threshold keeps our defaults for the rest (#216); deny_unknown_fields still rejects a typo’d key.
RustConfig
The [rust] table.
RustCoverage
[rust].coverage. A partial override#[serde(default)] fills any missing field from RustCoverage::default (lines = 100, regions = None), so a table that sets only regions keeps lines = 100 (#216); deny_unknown_fields still rejects a typo’d key. Branch coverage is experimental, so only regions/lines are configurable, and regions stays opt-in (None unless the table sets it).
TypeScriptConfig
The [typescript] table.
TypeScriptCoverage
[typescript].coverage. A partial override#[serde(default)] fills any missing field from TypeScriptCoverage::default, so a table that sets only one of the four metrics keeps our defaults for the rest (#216); deny_unknown_fields still rejects a typo’d key.

Enums§

Rule
A rule a file can be exempted from (issue #32).

Functions§

load_config
Read one config file at path into a Config, validating it on the way.
resolve_exempt
Resolve the set of exempt paths for rule from exemptions, validating that each still points to a file under root.