Skip to content

Remove the literal % from [tool.check_test_layout].reason — it crashes configparser-based tools #905

Description

@tschm

Subcategory: tooling robustness / cross-tool compatibility

The reason string in [tool.check_test_layout] contains a literal 100%. Tools that read
pyproject.toml's [tool.*] tables through Python's configparser treat % as interpolation
syntax and crash outright — not degrade, crash — on any invocation inside this repo.

Evidenceuvx radon cc src -a -s from the repo root:

File ".../radon/cli/__init__.py", line 85, in file_config
    config.read_dict(FileConfig.toml_config())
  File ".../configparser.py", line 440, in before_set
    raise ValueError("invalid interpolation syntax in %r at position %d" ...)
ValueError: invalid interpolation syntax in 'Tests are organised by behaviour under
tests/test_jquantstats/; per-module coverage is guaranteed by the 100% pytest coverage gate
rather than 1:1 file mirroring.' at position 108

Both radon cc and radon mi fail this way. The complexity metrics for this repo's
/rhiza:quality assessment had to be gathered by running radon from a different working
directory with an absolute path — the numbers themselves were fine (average CC A/2.83, no block
ranked C or worse, every module A on maintainability index), but nobody running radon normally
would get that far.

Changepyproject.toml, [tool.check_test_layout].reason: replace 100% with wording
that avoids the character, e.g. "…guaranteed by the full-coverage pytest gate…" or "…by the
pytest coverage gate at its configured threshold…". Escaping as 100%% also satisfies
configparser but reads wrong to anyone else and would show up literally in other tools.

The opt-out itself is correct and should stay — check_test_layout.py accepts it and exits 0
with "parity not enforced by request".

Done when: uvx radon cc src -a -s runs to completion from the repo root.


Filed from a /rhiza:quality run on 2026-08-01.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions