Skip to content

linting: Phase-1 follow-up polish (no-empty-link, hard-break toggle, doctests) #96

Description

@lbliii

Non-blocking polish items deferred from #56 (Phase-1 of the patitas.linting framework, delivered in #95). All are by-design for Phase-1 and verified non-blocking by the implementation's adversarial review.

  1. no-empty-link — tag-only inline HTML treated as visible. _has_visible_content (rules.py) counts any HtmlInline whose html.strip() is non-empty as visible, so [<span></span>](url) (renders zero visible text) is not flagged — a latent false negative. Also prefer explicit match arms over the getattr(node, "children"/"html") duck-typing while here. Options: match concrete empty/void elements, or document explicitly as by-design.

  2. trailing-whitespaceallow_hard_break_spaces toggle. Lines ending in exactly two spaces are intentional Markdown hard breaks (markdownlint MD009), currently flagged at INFO. Add a documented opt-out. Note: the config mechanism this needs is now tracked by linting: rule configuration surface (enable/disable, severity, options) #98 (rule configuration surface) — implement the toggle there, or as a follow-on once linting: rule configuration surface (enable/disable, severity, options) #98 lands.

  3. registry.py doctest style. Docstring examples print LintRuleRegistryBuilder(...) as expected output, but the builder has no custom __repr__, so python -m doctest registry.py would fail. Doctests are not CI-wired (and the cloned-from roles/registry.py shares this style), so it's harmless — but drop the expected-output lines or add # doctest: +ELLIPSIS.

  4. Runner / edge-case test-hardening (adversarial pass flagged, not yet covered): assert rules=() returns []; a non-rule object passed as a rule fails cleanly via the registry TypeError (not deep in the runner); a Document with end_lineno=None does not break code-block exclusion — a regression guard for the trailing-whitespace span fix from linting: add patitas.linting content-linting framework (#56) #95.

  5. Tidy real trailing-whitespace in repo docs. docs/performance-investigation.md has 3 genuine trailing-space lines (a metadata hard-break block) the linter flags at INFO. Clean them, or let the item-2 toggle handle it once available.

Parent epic: #56 · Saga: #53

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority / nice-to-havetaskConcrete, self-contained unit of worktheme:lintingTheme: linting

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions