Skip to content

Release v0.8.1

Choose a tag to compare

@github-actions github-actions released this 26 Sep 07:32
· 958 commits to main since this release

TopMark v0.8.1 — XML re-apply fix, opt-in dev validation, and typing hardening

Highlights

  • XML re-apply fix: Prevents double-wrapped <!-- … --> blocks by anchoring bounds via character offsets in XML/HTML processors. This makes repeated runs idempotent even on files with mixed/newline quirks.

Added

  • Developer validation (opt-in)
    Set TOPMARK_VALIDATE=1 to run extra sanity checks during tests:
    • Processor ↔ FileType registry integrity.
    • Ensures XML-like processors use the char-offset strategy (NO_LINE_ANCHOR for line index).
  • Docs
    • Clarified placement strategies (line-based vs char-offset) in base.py / xml.py.
    • New page: docs/ci/dev-validation.md; updated CONTRIBUTING.

Changed

  • Processor refactor
    • Introduced mixins: LineCommentMixin, BlockCommentMixin, XmlPositionalMixin.
    • New façade compute_insertion_anchor(); updater routes through it.
    • Typing tightened: e.g., Final[int] for NO_LINE_ANCHOR; micro-perf via cached encoding regex.
  • File types
    • Instances module is now lazy, plugin-aware, and type-safe; split out detectors (incl. JSONC).

Fixed

  • XML idempotency: re-applying headers no longer nests comment fences.
  • Type checking / mypy: fixes for generator returns, entrypoint discovery, and strict annotations.

CI / Tooling

  • New CI job: “Dev validation” runs tests marked dev_validation under TOPMARK_VALIDATE=1.
  • Pre-commit: ruff-pre-commit bumped to v0.13.2.

Compatibility

  • Breaking changes: None.
    The release is drop-in for users on 0.8.0.

Upgrade notes

No config changes required. If you work on processor internals or plugins:

  • Consider enabling TOPMARK_VALIDATE=1 locally or in CI to catch registry/positioning regressions early.

Links