# Move custom rules to markdownlint-rules; ascii-only ignore code blocks; add document-length rule#5
Merged
Conversation
…locks - Rename .markdownlint-rules to markdownlint-rules; update paths in configs, workflows, Makefile, README, CONTRIBUTING, eslint, package.json, .gitignore. - ascii-only: skip content inside fenced code blocks by default; add allowUnicodeInCodeBlocks and disallowUnicodeInCodeBlockTypes options. - Update fixtures and expected_errors for ascii-only; adjust rule unit tests and Python verifier for new paths.
- Rule reports a single error on line 1 when the file exceeds a configurable maximum (default 1500). Config: document-length.maximum in .markdownlint.yml. - Register in .markdownlint-cli2.jsonc and .vscode/settings.json; document in markdownlint-rules README and root README. - Generate negative_document_length.md in verify_markdownlint_fixtures when missing (ensure_long_document_fixture); add Python test and expected_errors entry with comment on generation.
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.
Summary
.markdownlint-rulestomarkdownlint-rulesand update all path references.allowUnicodeInCodeBlocksanddisallowUnicodeInCodeBlockTypesoptions.Changes
1. Move custom rules to markdownlint-rules and ascii-only: ignore code blocks
.markdownlint-rules/tomarkdownlint-rules/..markdownlint-cli2.jsonc,.markdownlint.yml,.vscode/settings.json.github/workflows/*.yml,Makefile,README.md,CONTRIBUTING.mdeslint.config.cjs,package.json,.gitignore```or~~~). New options:allowUnicodeInCodeBlocks(defaulttrue) – whenfalse, check code blocks for non-ASCII.disallowUnicodeInCodeBlockTypes– when not allowing Unicode in code blocks, restrict to these block types (e.g.["text"]); empty = all.expected_errors.ymlupdated for ascii-only; rule unit tests and Python verifier adjusted for new paths.2. Add document-length custom markdownlint rule (max 1500 lines)
document-length.js– reports a single error on line 1 when the file has more thanmaximumlines (default 1500).document-length.maximumin.markdownlint.yml(positive integer)..markdownlint-cli2.jsoncand.vscode/settings.json; documented inmarkdownlint-rules/README.mdand rootREADME.md.negative_document_length.mdis generated byverify_markdownlint_fixtures.pywhen missing (ensure_long_document_fixture); entry and comment inexpected_errors.yml; Python testtest_verify_document_length_generated_fixturegenerates, verifies, and removes the file.Testing
make test-rules/make test-rules-coverage– rule unit tests (including document-length).make test-markdownlint– fixture verification (generates long fixture if missing).make test-python– Python tests including document-length generated-fixture test.make ci– full CI (lint + tests + coverage).