-
Notifications
You must be signed in to change notification settings - Fork 3
Markdownlint Showcase #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA new markdownlint configuration file and a sample markdown file were added. The configuration enables specific linting rules and sets the output format for markdownlint-cli2. The sample markdown file contains structured data with intentional formatting inconsistencies to test linting behavior. Changes
Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
markdownlint/test.md (2)
2-2
: Fix indented line – breaks the key/value alignmentThe leading space before
version:
breaks the YAML-like structure and triggers MD007/MD013. Remove the extra space to keep the top-level keys aligned.- version: 1.0 +version: 1.0
5-5
: Remove trailing whitespace – caught by MD009Lines 5 and 9 end with spaces; markdownlint will flag them. Strip the blanks to keep the file clean.
Also applies to: 9-9
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
markdownlint/.markdownlint-cli2.jsonc
(1 hunks)markdownlint/test.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdownlint/test.md
[grammar] ~6-~6: Ensure spelling is correct
Context: ... - id: 1 name: Item One - id: 2 name: Item Two - id: 3 name: Item Three...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
markdownlint/test.md
4-4: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
6-6: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
8-8: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
🔇 Additional comments (1)
markdownlint/.markdownlint-cli2.jsonc (1)
2-2
: Confirm the formatter module name
markdownlint-cli2-formatter-json
shipped under that exact name only from v0.7.0 upwards.
Double-check yourpackage.json
/CI image versions to make sure the formatter resolves at runtime.
"default": true, | ||
"MD001": true, | ||
"MD002": true, | ||
"MD022": true, | ||
"MD031": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Disable the global default before whitelisting specific rules
"default": true
turns on every rule, then the explicit list immediately re-enables them again.
If you want to lint with only MD001/2/22/31, flip the flag to false
(or drop it entirely and let the explicit mapping drive the set). This avoids surprises when markdownlint introduces new rules.
- "default": true,
+ "default": false,
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"default": true, | |
"MD001": true, | |
"MD002": true, | |
"MD022": true, | |
"MD031": true | |
"default": false, | |
"MD001": true, | |
"MD002": true, | |
"MD022": true, | |
"MD031": true |
🤖 Prompt for AI Agents
In markdownlint/.markdownlint-cli2.jsonc around lines 4 to 8, the "default":
true setting enables all rules globally, which conflicts with the explicit rule
list and may cause unexpected linting when new rules are added. Change "default"
to false or remove it entirely so only the explicitly listed rules (MD001,
MD002, MD022, MD031) are enabled, preventing unintended rule activation.
- id: 1 | ||
name: Item One | ||
- id: 2 | ||
name: Item Two | ||
- id: 3 | ||
name: Item Three |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Normalise list indentation
Each list item should start at the same column. Current mixture of 2- and 3-space indents violates MD007.
-items:
- - id: 1
- name: Item One
- - id: 2
- name: Item Two
- - id: 3
- name: Item Three
+items:
+ - id: 1
+ name: Item One
+ - id: 2
+ name: Item Two
+ - id: 3
+ name: Item Three
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 LanguageTool
[grammar] ~6-~6: Ensure spelling is correct
Context: ... - id: 1 name: Item One - id: 2 name: Item Two - id: 3 name: Item Three...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
4-4: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
6-6: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
8-8: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
🤖 Prompt for AI Agents
In markdownlint/test.md around lines 4 to 9, the list items have inconsistent
indentation with a mix of 2 and 3 spaces. Normalize the indentation so that each
list item starts at the same column, using consistent spaces (preferably 2
spaces) before each list item to comply with MD007.
Summary by CodeRabbit