build: migrate markdownlint from Ruby (mdl) to Node.js (markdownlint-cli2)#17191
build: migrate markdownlint from Ruby (mdl) to Node.js (markdownlint-cli2)#17191nagendrareddy10 wants to merge 3 commits intoistio:masterfrom
Conversation
…cli2) Replaces the Ruby markdownlint gem (mdl) with the Node.js markdownlint-cli2 package, which uses the more actively maintained markdownlint engine. Changes: - Add .markdownlint.yaml: translates all mdl.rb rules to markdownlint-cli2 YAML format - scripts/lint_site.sh: replace mdl invocation with markdownlint-cli2 - Makefile.core.mk: add markdownlint-cli2@v0.17.2 to netlify_install npm deps - Remove mdl.rb (replaced by .markdownlint.yaml) Fixes: istio#15148
|
Hi @nagendrareddy10. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
…l.rb markdownlint-cli2 enforces several rules by default that the Ruby mdl gem never checked. This caused thousands of lint errors across existing content files in the repo that predate this PR. Disable all rules not in the original mdl.rb to maintain exact parity with the previous linting behavior: - MD004 (ul-style): unordered list marker style (dash vs asterisk) - MD034 (no-bare-urls): bare URLs in text - MD049 (emphasis-style): emphasis marker style - MD050 (strong-style): strong marker style - MD051 (link-fragments): link fragment validation - MD055 (table-pipe-style): table pipe style - MD056 (table-column-count): table column count These can be re-enabled in future PRs with targeted fixes to the content.
|
@nagendrareddy10 I did try this one here #16316. It is actually very complex to migrate preserving all the rules. |
|
did you use AI in the construction of this PR? |
Yes i did use AI suggestions for few build issue fixes. |
Description
Migrates the markdown linting toolchain from the Ruby
mdlgem to the Node.jsmarkdownlint-cli2package (issue requested eithermarkdownlint-cliormarkdownlint-cli2; chosecli2as it is the more actively maintained of the two).Why migrate?
mdlgem is less actively maintained than the Node.js engine.markdownlint-cli2enables inline rule suppression via HTML comments (e.g. ``), which was one of the primary motivations in the original issue.sass,typescript,esbuild).Changes
.markdownlint.yamlmdl.rbRuby rules to YAML formatscripts/lint_site.shmdl --ignore-front-matter --style mdl.rb .withmarkdownlint-cli2 "**/*.md"Makefile.core.mkmarkdownlint-cli2@v0.17.2tonetlify_installnpm dependenciesmdl.rb.markdownlint.yamlRule mapping (mdl.rb → .markdownlint.yaml)
Legacy exclusions from
mdl.rbhave been faithfully migrated:MD013,MD014,MD030,MD032,MD033,MD041,MD046✅ all disabled (matching excludes)MD002✅ level:2 preservedWhy are other rules disabled?
markdownlint-cli2leverages a much stricter and more accurate markdown AST parser thanmdldid. Running the new Node engine immediately flagged over 1,000 legacy formatting violations across the repository (primarily incontent/zh/andcontent/uk/), whichmdl.rbquietly ignored under-the-hood.To avoid conflating a simple CI infrastructure migration with a massive codebase re-formatting spanning thousands of files (which would trigger sweeping git conflicts for translation teams), we have purposefully disabled these newly-flagged discrepancies in
.markdownlint.yaml. This ensures 1:1 behavioral parity with the oldmdlpipeline and perfectly "solves the original task" by keeping the build green. Maintainers can re-enable these granular rules in isolated follow-up PRs!Reviewers
Fixes: #15148