Skip to content

[Tracking] latex_lint rule wrapping chktex / lacheck #5

Description

@nicklambourne

Background

LaTeX has two mature linters:

  • chktex (ships with TeX Live): finds suspicious constructs,
    missing whitespace around math operators, etc.
  • lacheck (older, looser): focuses on bracket/environment
    matching.

rules_latex could expose these as a latex_lint test rule that
runs the linter on a document's transitive sources and fails the
build on warnings (or on a configurable subset).

What this would look like

latex_lint(
    name = "paper_lint",
    document = ":paper",
    linter = "chktex",  # or "lacheck"
    fail_on = ["1", "3", "8"],  # chktex warning codes
)

Backed by an optional chktex field on latex_toolchain, similar
to biber.

Why deferred

  • Linters are nice-to-have, not required for a working LaTeX build
    pipeline.
  • chktex isn't shipped by Tectonic, so we'd need to source binaries
    for each platform — another biber-style toolchain repo with the
    same Linux arm64 gap pattern.
  • The signal-to-noise ratio of chktex's default output is famously
    low; users would need to configure heavily.

Source: DESIGN.md §5.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions