Repository navigation
Add a markdownlint rule policy and make the Markdown files pass it - #366
Merged
Merged
Conversation
scripts/check-markdown-links.sh stopped after the first link of the
first file and exited 1: under `set -e`, `((TOTAL_LINKS++))` returns
status 1 when the old value is 0. The four counters now use
`VAR=$((VAR + 1))`.
With the counters fixed, it reported 8 broken links, none of them
real:
- Five in .github/CODE_OF_CONDUCT.md. In `[ref]: url` definitions the
pattern `[^\s]+` means "not a backslash or s" in ERE, so
https://... was cut to "http" and checked as a file. The pattern
now uses `[^[:space:]]`.
- Three were bracket text inside fenced code blocks
(`log_line_prefix = '... [%l-1] ...'`, `[serviceName: string]:
ServiceHealth`, `{ [key: string]: string }`). Lines inside ``` and
~~~ fences are now skipped.
On this tree it checks 1,276 links in 55 files and reports none
broken. tests/test-check-markdown-links.sh runs the checker on
fixture files: with the old checker all four tests fail; with each
of the two pattern fixes reverted on its own, only its test fails.
CI runs the tests and then the checker in the Test Documentation job.
The markdownlint pre-commit hook (markdownlint-cli 0.38.0, default rules) reported 10,271 findings in the 162 Markdown files on 40d8b32. .markdownlint.yaml now sets the policy; each change carries its reason in the file: - Disabled: MD013 line length (2,081), MD029 ordered-list prefixes (237), MD036 emphasis as heading (311), MD040 fence language (380), MD041 first-line heading (1, the pull request template). - Narrowed: MD010 hard tabs skips code blocks, so the Makefile tabs in reference-apps/API_PATTERNS.md stay (14 findings, all inside code blocks). MD024 duplicate headings reports same-parent duplicates only (215 before, none after). MD033 inline HTML allows <br> (3, all in table cells). The rest are fixed in the files: - `markdownlint --fix` (the hook's own argument) for MD032, MD031, MD022, MD012 blank lines, MD007 and MD005 list indentation, MD004 list marker, MD034 bare URLs (wrapped in <>), and MD026 trailing colons in 19 headings. GitHub drops the colon from the anchor, so no anchor changes. - MD037: nine fill-in blanks (`___`) in wiki/Improvement-Task-List.md are escaped as `\_\_\_`, which renders the same; the fixer would have joined them into emphasis. - MD038: the one code span holding a single space, in wiki/Link-Fixes-Summary.md, keeps it under a same-line disable comment. - MD051: 74 link fragments did not match any anchor on GitHub. Each now uses the anchor GitHub generates, checked against the rendered HTML from the contents API: `&` leaves a double hyphen, and an emoji with U+FE0F leaves the U+FE0F. Links to sections that no longer exist were pointed at the section that replaced them or removed. The table of contents of .github/CHANGELOG.md is rebuilt from its headings (it listed headings that exist only inside a code example and an HTML comment, and omitted four releases), as is the stale one in wiki/Migration-Guide.md. reference-apps/CHANGELOG.md had two more release links of the same kind. Checks, before and after, parsing every Markdown file with markdown-it-py: the content of every code block is identical, every heading anchor is identical, and the only changed link targets are the fragment fixes above. Rendered text differs only in the 19 heading colons and the edited tables of contents. `pre-commit run --all-files` passes every hook; scripts/wiki-mirror.sh --check, scripts/check-markdown-links.sh (1,279 links, none broken) and tests/test-documentation-accuracy.sh (12/12) pass. The detect-secrets baseline was rescanned (1.4.0): the same 108 findings, 35 at new line numbers. The Markdown Lint job in lint.yml stays advisory: markdownlint-cli2 0.23.2 also reads .markdownlint.yaml and still reports its newer table rules (MD060 2,963, MD058 20, MD056 14). The job comment says so.
NormB
force-pushed
the
fix/markdownlint
branch
from
October 15, 2026 15:16
aa75bd6 to
69338cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
pre-commit run markdownlint --all-filespass, with a rule policy in.markdownlint.yaml, and fixes the local link checker that this work needed.Commits
scripts/check-markdown-links.shexited 1 after the first link (((TOTAL_LINKS++))underset -e). With that fixed it reported 8 false positives:[^\s]in ERE cuthttps://reference definitions tohttp, and bracket text inside code blocks was read as links. Newtests/test-check-markdown-links.sh(4 tests on fixture files) fails 4/4 on the old checker; reverting either pattern fix alone fails only its test. CI runs the tests and the checker in the Test Documentation job.Rule decisions (markdownlint-cli 0.38.0, 10,271 findings on 40d8b32)
texteverywhere adds no informationcode_blocks: false: all 14 are inside code blocks (Makefile tabs inreference-apps/API_PATTERNS.md)siblings_only: true: 0 remainallowed_elements: [br]: line breaks in table cells--fix--fix; GitHub drops:from anchors, so no anchor changes___fill-in blanks escaped as\_\_\_(same rendering);--fixwould have made them emphasisChecks
reference-apps/API_PATTERNS.mdkeeps its 7 tab lines.uvx pre-commit run --all-files: every hook passes.scripts/wiki-mirror.sh --check: current (16 files).scripts/check-markdown-links.sh: 1,279 links, 0 broken.tests/test-documentation-accuracy.sh: 12/12.Not done
The advisory Markdown Lint job (markdownlint-cli2 0.23.2) reads the same config and still reports newer table rules: MD060 2,963, MD058 20, MD056 14. The job comment in
lint.ymlnow says this; making it a gate needs a decision on those rules.