Repository navigation
Release v0.8.1
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)
SetTOPMARK_VALIDATE=1to run extra sanity checks during tests:- Processor ↔ FileType registry integrity.
- Ensures XML-like processors use the char-offset strategy (
NO_LINE_ANCHORfor 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.
- Clarified placement strategies (line-based vs char-offset) in
Changed
- Processor refactor
- Introduced mixins:
LineCommentMixin,BlockCommentMixin,XmlPositionalMixin. - New façade
compute_insertion_anchor(); updater routes through it. - Typing tightened: e.g.,
Final[int]forNO_LINE_ANCHOR; micro-perf via cached encoding regex.
- Introduced mixins:
- 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_validationunderTOPMARK_VALIDATE=1. - Pre-commit:
ruff-pre-commitbumped tov0.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=1locally or in CI to catch registry/positioning regressions early.
Links
- PyPI: https://pypi.org/project/topmark/
- Docs: https://shutterfreak.github.io/topmark/
- Full changelog: see
CHANGELOG.mdin the repo - Full Changelog: v0.8.0...v0.8.1