Skip to content

Four measured defects in the carried .markdownlint-cli2.jsonc, including an inverted MD060 comment #1495

Closed

Description

@ptr727

Found by the whole-unit review passes on #1494 (settling #1487), which read .markdownlint-cli2.jsonc as a repository carrying it for the first time reads it. None was introduced by that change, so all four are filed rather than fixed there. Each was measured against markdownlint-cli2 0.23.2, the build bundled in the pinned markdownlint-cli2-action v24.2.0.

1. The MD060 comment has compact and tight inverted

The canonical carries:

// MD060 (table column style) is not enforced - allow both compact
// (`|a|b|`) and padded (`| a | b |`) table pipe spacing.
"MD060": false

MD060's compact requires the padded form and tight requires the unpadded one, which is the reverse of what the comment's parenthetical labels say. Measured, with a |a|b| table and a | a | b | table in the tree:

Setting Result
{"MD060": {"style": "compact"}} flags the |a|b| table, Table pipe is missing space to the right for style "compact"
{"MD060": {"style": "tight"}} flags the | a | b | table, Table pipe has space to the left for style "tight"

A repository re-enabling the rule from this comment's words picks the style that forbids the form it meant to keep. The comment is carried byte-identical fleet-wide, so every carrier holds the inversion.

2. The stated reason for disabling MD060 is not the reason

The comment says the disable is what allows both spacings. Measured at the rule's default (style: "any"), a |a|b| table, a | a | b | table, and a | a | bbbb | table all lint clean, so both spacings are already allowed with the rule enabled. What false actually buys is tolerating a table matching none of aligned, compact, or tight: a | a | b | header with a |1| 2 | row flags does not align with header for style "aligned" under the default and is silenced only by the disable. The comment describes a restriction that does not exist and omits the one the key removes.

3. Config globs is additive to command-line arguments, so a per-file invocation lints the whole tree

e7cb1cf (#1474) added "globs": ["**/*.md"]. Command-line globs union with that entry rather than replacing it, so naming one file lints everything:

$ markdownlint-cli2 tight.md
Finding: tight.md **/*.md !**/node_modules/**

Two consequences in the fleet's own surfaces. scripts/docker_lint.py passes an explicit file list in size-bounded batches (MAX_FILE_ARGUMENT_BYTES), so each batch now re-lints the whole tree rather than its own slice. And an editor or hook action that lints the current file reports failures in files the invoker never touched. --no-globs is the escape hatch and is named nowhere.

This does not affect the CI exclusion input: a negated command-line glob still subtracts even with the config's positive entry present, verified with the exact CI shape ("**/*.md" '!content/**'), so markdown-exclude-globs is unharmed. Only positive command-line globs are additive.

4. globs covers .md but not .markdown

markdownlint-cli2's own default glob is *.{md,markdown}. The canonical narrows it to **/*.md, and neither the CI action's input nor scripts/docker_lint.py's target list covers .markdown either, so a legacy.markdown file is silently unlinted and the run exits 0. That is a narrower instance of the same silent-clean hole the globs key was added to close.

5. "gitignore": true carries no comment

It is the only key in a file whose convention is one stated rationale per decision. Its behavior is not obvious and is stated nowhere: it applies nested .gitignore files as well as the root one, works with no git repository present, and is read only from the run-root config, so a carrier copying it into a nested config gets an inert key.

Activity

  1. ptr727 commented on Oct 23, 2026

    @ptr727
    OwnerAuthor

    Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions