mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #194] markdownlint-enable after markdownlint-disable no longer respects rules set in config #2016
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2016
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @boneskull on GitHub (Jun 6, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/194
I have a file containing some automatically-generated markdown.
I would like markdownlint to ignore the auto-generated content, so I wrap the section with this:
In my
.markdownlint.json, I have this rule:However, markdownlint complains that a line following (not immediately after) the
<!-- markdownlint-enable -->exceeds the expected line length of 80.This error is only emitted if I use the disable/enable wrapper.
Essentially, this seems to imply that
<!-- markdownlint-enable -->does not re-read the configuration, and instead reverts to the default. This problem can be trivially reproduced with this file:@boneskull commented on GitHub (Jun 6, 2019):
I have a feeling this is user error, but that's unclear from the documentation. I would need to explicitly disable and re-enable explicit rules, which is a bit painful, as a user.
@DavidAnson commented on GitHub (Jun 6, 2019):
This definitely sounds like the wrong behavior for your scenario, but I’m afraid I may have done it this way for a reason. I’ll need to review the code and maybe think about this a little. Thanks for the very detailed report and investigation!
@DavidAnson commented on GitHub (Jun 6, 2019):
It’s slowly coming back to me… I think we agree that “enable“ of a single rule should turn that rule on no matter what else happened before? So then doesn’t it make sense that “enable” of all rules would do the same? OK, maybe not, but I think that’s the motivation behind the current behavior. What I may need to do is add some kind of a push/pop or save/restore ability for the scenario you’re dealing with.