[PR #916] [MERGED] Consistent rule references in tests #1114

Closed
opened 2026-03-03 02:01:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/DavidAnson/markdownlint/pull/916
Author: @tommy-gilligan
Created: 7/22/2023
Status: Merged
Merged: 7/28/2023
Merged by: @DavidAnson

Base: nextHead: consistent-rule-references-in-tests


📝 Commits (2)

  • b6f5e85 Always refer to rules by name (not number) in test configs
  • 59baf40 Remove unused branch

📊 Changes

131 files changed (+412 additions, -396 deletions)

View changed files

📝 demo/markdownlint-browser.js (+1 -1)
📝 lib/markdownlint.js (+1 -1)
📝 test/4-tabs-MD010.md (+3 -3)
📝 test/MD001-MD010.md (+3 -3)
📝 test/MD011-MD021.md (+1 -1)
📝 test/MD031-MD040.md (+3 -3)
📝 test/MD041-MD050.md (+4 -4)
📝 test/alternate_top_level_heading.md (+3 -3)
📝 test/atx_closed_heading_spacing.md (+2 -2)
📝 test/atx_heading_spacing.md (+2 -2)
📝 test/blanks-around-headings-0-2.md (+3 -3)
📝 test/blanks-around-headings-3-0.md (+3 -3)
📝 test/blanks-around-headings.md (+1 -1)
📝 test/break-all-the-rules.md (+4 -4)
📝 test/bulleted_list_2_space_indent.md (+1 -1)
📝 test/bulleted_list_not_at_beginning_of_line.md (+1 -1)
📝 test/code-block-with-language-allowed.md (+2 -2)
📝 test/code-block-with-tabs-allowed.md (+1 -1)
📝 test/code-blocks-prefixed-by-spaces.md (+1 -1)
📝 test/code_block_dollar_fence-empty.md (+1 -1)

...and 80 more files

📄 Description

This is really in response to https://github.com/DavidAnson/markdownlint/pull/845#discussion_r1225579458

I think it makes sense to always refer to rules by human-readable name in test configs for clarity.

Referring to rules by number in expectations then makes less sense. The rules could always be referred to by name in expectations but ultimately there is some file lib/md###.js that will be relevant when fixing a test. This is why I've gone with number:name for expectations. This format has meant that in some instances lines are long enough to break line-length rule.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/DavidAnson/markdownlint/pull/916 **Author:** [@tommy-gilligan](https://github.com/tommy-gilligan) **Created:** 7/22/2023 **Status:** ✅ Merged **Merged:** 7/28/2023 **Merged by:** [@DavidAnson](https://github.com/DavidAnson) **Base:** `next` ← **Head:** `consistent-rule-references-in-tests` --- ### 📝 Commits (2) - [`b6f5e85`](https://github.com/DavidAnson/markdownlint/commit/b6f5e85250e9e9aa78b2824878de6f3f1df874af) Always refer to rules by name (not number) in test configs - [`59baf40`](https://github.com/DavidAnson/markdownlint/commit/59baf40a43bdb2237dc2cfa1b71607e0a1bd53d9) Remove unused branch ### 📊 Changes **131 files changed** (+412 additions, -396 deletions) <details> <summary>View changed files</summary> 📝 `demo/markdownlint-browser.js` (+1 -1) 📝 `lib/markdownlint.js` (+1 -1) 📝 `test/4-tabs-MD010.md` (+3 -3) 📝 `test/MD001-MD010.md` (+3 -3) 📝 `test/MD011-MD021.md` (+1 -1) 📝 `test/MD031-MD040.md` (+3 -3) 📝 `test/MD041-MD050.md` (+4 -4) 📝 `test/alternate_top_level_heading.md` (+3 -3) 📝 `test/atx_closed_heading_spacing.md` (+2 -2) 📝 `test/atx_heading_spacing.md` (+2 -2) 📝 `test/blanks-around-headings-0-2.md` (+3 -3) 📝 `test/blanks-around-headings-3-0.md` (+3 -3) 📝 `test/blanks-around-headings.md` (+1 -1) 📝 `test/break-all-the-rules.md` (+4 -4) 📝 `test/bulleted_list_2_space_indent.md` (+1 -1) 📝 `test/bulleted_list_not_at_beginning_of_line.md` (+1 -1) 📝 `test/code-block-with-language-allowed.md` (+2 -2) 📝 `test/code-block-with-tabs-allowed.md` (+1 -1) 📝 `test/code-blocks-prefixed-by-spaces.md` (+1 -1) 📝 `test/code_block_dollar_fence-empty.md` (+1 -1) _...and 80 more files_ </details> ### 📄 Description This is really in response to https://github.com/DavidAnson/markdownlint/pull/845#discussion_r1225579458 I think it makes sense to always refer to rules by human-readable name in test configs for clarity. Referring to rules by number in expectations then makes less sense. The rules could always be referred to by name in expectations but ultimately there is some file `lib/md###.js` that will be relevant when fixing a test. This is why I've gone with `number:name` for expectations. This format has meant that in some instances lines are long enough to break `line-length` rule. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 02:01:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#1114
No description provided.