Skip to content

Carried markdownlint config ignores nothing under node_modules, because gitignore:true is its only ignore source #1466

Closed

Description

@ptr727

Found resyncing ptr727/aiopurpleair against hub 8195c43, and raised by Copilot on that repo's promotion PR. Filing here rather than fixing downstream, since the file is carried verbatim and the defect is this template's.

The defect

.markdownlint-cli2.jsonc sets "gitignore": true and declares no ignores block. That makes the ignore set exactly what .gitignore holds, and neither this repository's .gitignore nor any carrier's lists node_modules.

So a checkout that has ever run a Node tool locally, which is the ordinary state for anyone who installed markdownlint-cli2 or cspell from npm rather than through Docker, lints third-party Markdown under node_modules/ and walks that tree to do it. The failure is local-only, since CI checks out clean, which is what makes it easy to carry indefinitely: it never reds a build, it just makes the documented local command slow and noisy for the person who followed the instructions.

Verified across the fleet, not inferred

Repository node_modules in .gitignore ignores in .markdownlint-cli2.jsonc
ProjectTemplate (canonical) no no
LanguageTags no no
Utilities no no
PlexCleaner no no
aiopurpleair no no
Financial-Modeling no yes

Financial-Modeling is the outlier that already solved it locally, which is itself worth reconciling: either its ignores block is the fix to promote, or it is drift against a canonical that should have carried the fix.

Why it was declined downstream

spec/files.json declares .markdownlint-cli2.jsonc verbatim, whole-file. aiopurpleair's copy currently audits as stale (matches a past hub revision, re-vendor it). Editing it there would reclassify it modified, meaning the repository changed fixed content, and hand the next resync a judgment call about whether to promote or erase the change. That is the state verbatim fidelity exists to prevent, so the fix has to originate here to reach carriers cleanly.

Two candidate fixes, and they are not equivalent

  1. Add an ignores block to the canonical. Scoped to the linter, and independent of what any repository chooses to gitignore. It does mean the config no longer derives its ignore set purely from .gitignore, which is the simplicity "gitignore": true was presumably chosen for.
  2. Add node_modules/ to the carried .gitignore. Keeps the single source, and fixes the same class for every other tool that reads .gitignore. But .gitignore is not currently a carried file in spec/files.json, so this needs a manifest decision before it can reach carriers at all.

The second looks more correct and costs more to adopt. Flagging the choice rather than assuming it.

Audit run stamp: audit run 2026-09-09T02:08:56Z | hub 8195c43.

Activity

  1. ptr727 commented on Sep 9, 2026

    @ptr727
    OwnerAuthor

    Fixed on develop in e7cb1cf (#1474), taking candidate 1, with two corrections to the framing.

    Candidate 2 rests on a wrong premise. .gitignore is declared in spec/files.json, at presence fidelity. So hub content never propagates and a carrier would keep the defect. Raising the fidelity is not the fix either, since intent never judges content and a .gitignore legitimately varies by language, which is why it sits at presence. node_modules/ is added to this repository's own .gitignore regardless, where it is what keeps a local install out of a git add.

    The ignores entry needs globs beside it. Measured on markdownlint-cli2 v0.23.2: with an ignores entry and no positive glob, a bare markdownlint-cli2 reports Linting: 0 files and exits 0, where the same invocation before the change exited 2 on a usage error. So candidate 1 on its own trades a loud failure for a silent one. A command-line glob still unions with the config's, and a command-line negation still wins, so a repository narrowing markdown-exclude-globs is unaffected.

    The pattern is **/node_modules/**, because node_modules and node_modules/ each matched the root copy only and left a nested workspace copy linted.

    A sibling exposure the config cannot reach. scripts/docker_lint.py discovers targets with git ls-files --others --exclude-standard, so an untracked, unignored node_modules/**/*.sh became a shellcheck and shfmt target. Neither tool has an ignore config, so the exclusion went into discovery, with three tests. editorconfig-checker and cspell are immune, measured rather than assumed: the first excludes node_modules by default, the second takes two literal root paths.

    Financial-Modeling is not the outlier this issue took it for. Its ignores entries are data/** and notes/forms-decisions.md, a committed document archive and the owner's working notes. Neither is node_modules, so there was nothing there to promote. It is genuinely modified against this canonical and is absent from spec/divergences.json, which needs its own disposition, filed separately. Its comment did already identify the silent-zero-files hazard above, which is where the globs half of the fix came from.

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