Skip to content

Avoid partial table rewrites that still fail line-length linting #324

Description

@lodyai

Summary

mdtablefix --wrap rewrites Markdown tables but can still leave table rows that fail the repository Markdown lint gate for line length. In practice, running the formatter can produce a modified tree that still fails markdownlint.

Reproduction

From leynos/ddlint on branch docs/import-rust-agent-template:

fd --print0 --type f --extension md --extension markdown --extension mdx . \
  | xargs -0 mdtablefix --wrap --renumber --breaks --ellipsis --fences --in-place
markdownlint docs/differential-datalog-parser-syntax-spec-updated.md docs/rust-testing-with-rstest-fixtures.md

Examples

docs/differential-datalog-parser-syntax-spec-updated.md has a compact precedence table. The formatter realigns it, but the table rows remain over 80 columns and still trigger MD013/line-length.

docs/rust-testing-with-rstest-fixtures.md has a quick-reference table. The formatter narrows some columns, but rows remain too long and the file still fails the same lint rule.

Expected behaviour

If --wrap is enabled and a table cannot be made compliant with the configured line length, the formatter should either:

  • leave the table unchanged and report that it could not be wrapped safely;
  • provide a deterministic wrapped-table representation that passes Markdown linting; or
  • document that tables are intentionally out of scope for line-length compliance and avoid partial realignment churn.

Actual behaviour

The formatter rewrites table alignment but does not make the table pass the line-length gate, leaving users with both a noisy diff and a failing formatter/linter pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions