Skip to content

topmark.filetypes.checks package index

topmark / filetypes / checks

Insert-checker utilities for TopMark file types.

This package provides file-type specific checks (InsertChecker instances) that determine whether a TopMark header can be safely inserted into a given file.

Unlike content matchers (see topmark.filetypes.detectors), which classify a file's type by examining its content, insert checkers focus on pre-insert eligibility. For example, a checker may forbid inserting a header into a JSON file that is actually JSON without comments, or into an XML document missing a declaration.

Responsibilities
  • Expose reusable, file-type specific InsertChecker callables.
  • Encapsulate constraints that go beyond syntax (e.g., semantic restrictions).
  • Surface advisory reasons when insertion is not supported.
Relationship

Immediate children in this package

topmark.filetypes.checks.json_like
Pre-insert checker for JSON-like files.
topmark.filetypes.checks.xml
Pre-insert checker for XML files.