mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #545] MD053 should support "[//]: # (Comment)" pattern by default #445
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#445
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 @ssbarnea on GitHub (Aug 2, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/545
This seems to be a regression introduced by
v0.32.1release which affects people using markdown comments as recommended here, which is hugely popular, with almost 2k upvotes. We used the format below in order to add some placeholder comments which are needed when we compile the documentation, so we know were a specific section starts or ends.This worked fine until yesterday, when pre-commit monthly update upgraded markdownlint to v0.32.1.
Is there any workaround for this?
PS. Even a search on https://sourcegraph.com/search?q=context:global+%5B//%5D:+%23&patternType=literal can show that use of this is extremely popular.
@ssbarnea commented on GitHub (Aug 2, 2022):
I tried adding parentheses around the placeholder but prettier will reformat the line to make it like below, which is still not allowed by markfownlint:
@DavidAnson commented on GitHub (Aug 2, 2022):
A few clarifications:
v0.32.1refers to amarkdownlint-clirelease version.@ssbarnea commented on GitHub (Aug 2, 2022):
I did not test
0.32.0in particular and I suspect that the issue was caused by the introduction of this rule. As this rule was created many years after the practice of using that placeholder was standardized, I would say that it might be wise to adapt the rule to bypass that common pattern, which is not really a bug.The rule itself is benefit, I am not questioning its intentions and it would be sad to have to disable it. As I do not know any valid workaround that can be used and not conflict with other tooling (see comment about prettier reformatting it), I think it would be better to add an exception for this pattern inside the rule. WDYT?
IMHO, A linter aims to find bugs while minimizing the chance of producing false-positives. If there is a legit use-case that cannot be rewritten that produces a false-positive, it makes sense to tune the rule to avoid it.
@DavidAnson commented on GitHub (Aug 2, 2022):
Agreed. I am thinking I will add a configurable list of "unused" referenced labels to ignore and default it to just the "//" case you highlight as that seems to have gained traction with the community.
@DavidAnson commented on GitHub (Aug 3, 2022):
@ssbarnea Thank you for the sponsorship!
@ssbarnea commented on GitHub (Aug 9, 2022):
@DavidAnson Apparently the fix does not work yet, see https://results.pre-commit.ci/run/github/389989116/1660058623.KSC139LtSLeY6AHYF_SEtg -- now this might be related to the fact that the cli repo is maybe behind?
@DavidAnson commented on GitHub (Aug 9, 2022):
I published version 0.26.2 of the library last night and here is an example of your scenario not reporting an error: https://dlaa.me/markdownlint/#%25m%23%20Issue%20545%0A%0A%5B%2F%2F%5D%3A%20%23%20DO-NOT-REMOVE-README-TITLE%0A
Dependent project like CLI and CLI2 will pick up pick up the change soon.