Skip to content

# Move custom rules to markdownlint-rules; ascii-only ignore code blocks; add document-length rule#5

Merged
cypher0n3 merged 2 commits into
mainfrom
feat/doc-length+ascii-only-config
Feb 8, 2026
Merged

# Move custom rules to markdownlint-rules; ascii-only ignore code blocks; add document-length rule#5
cypher0n3 merged 2 commits into
mainfrom
feat/doc-length+ascii-only-config

Conversation

@cypher0n3
Copy link
Copy Markdown
Owner

Summary

  • Rename .markdownlint-rules to markdownlint-rules and update all path references.
  • ascii-only: Skip content inside fenced code blocks by default; add allowUnicodeInCodeBlocks and disallowUnicodeInCodeBlockTypes options.
  • document-length: New custom rule that reports when a file exceeds a configurable maximum line count (default 1500).

Changes

1. Move custom rules to markdownlint-rules and ascii-only: ignore code blocks

  • Rename .markdownlint-rules/ to markdownlint-rules/.
  • Update paths in:
    • .markdownlint-cli2.jsonc, .markdownlint.yml, .vscode/settings.json
    • .github/workflows/*.yml, Makefile, README.md, CONTRIBUTING.md
    • eslint.config.cjs, package.json, .gitignore
  • ascii-only: By default, do not report non-ASCII inside fenced code blocks (``` or ~~~). New options:
    • allowUnicodeInCodeBlocks (default true) – when false, check code blocks for non-ASCII.
    • disallowUnicodeInCodeBlockTypes – when not allowing Unicode in code blocks, restrict to these block types (e.g. ["text"]); empty = all.
  • Fixtures and expected_errors.yml updated for ascii-only; rule unit tests and Python verifier adjusted for new paths.

2. Add document-length custom markdownlint rule (max 1500 lines)

  • Rule: document-length.js – reports a single error on line 1 when the file has more than maximum lines (default 1500).
  • Config: document-length.maximum in .markdownlint.yml (positive integer).
  • Registered in .markdownlint-cli2.jsonc and .vscode/settings.json; documented in markdownlint-rules/README.md and root README.md.
  • Fixture: negative_document_length.md is generated by verify_markdownlint_fixtures.py when missing (ensure_long_document_fixture); entry and comment in expected_errors.yml; Python test test_verify_document_length_generated_fixture generates, 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).

…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.
@cypher0n3 cypher0n3 merged commit a279b6b into main Feb 8, 2026
15 checks passed
@cypher0n3 cypher0n3 deleted the feat/doc-length+ascii-only-config branch February 9, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant