mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #159] Add option to ignore files #138
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#138
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 @SetTrend on GitHub (Dec 13, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/159
Please add a configuration opportunity to exclude particular files from the linter.
Either allow globbing for the
config.filesoption:Or add a new configuration option, explicitly excluding files (again, with globbin):
@DavidAnson commented on GitHub (Dec 13, 2018):
Can you explain this request a bit more, please? As the caller, you control the contents of the files array - why not filter out the files you want before passing in the files array? You could use glob, or you could use any other technique. The current implementation allows complete flexibility to the caller.
(Aside: markdownlint-cli supports glob and the ability to exclude by glob - perhaps it is a good reference example?)
@SetTrend commented on GitHub (Dec 13, 2018):
Thanks, David,
I'm participating in the documentation repository of WebPack. Doing so, I wrote a script that concatenates their single MD pages into comprehensive chapter MD pages, so their information can be viewd/printed in one single document.
That's all highly dynamic. No static maintenance should be required to utilize this feature. This is particularly true due to the high amount of MD pages already present.
So I need wildcards to be able to exclude the generated files (in this particular project their filenames all start with an underscore) from the linter, since, of cource, chances are that headings are being duplicated in the compound files, which should not occur in the original files.
@SetTrend commented on GitHub (Dec 13, 2018):
I just went through the scripts in the
package.jsonfile of the project and noticed they are usingmarkdown-cli. I will see if I can use globbing there, as you suggested. Thanks for the hint! As soon as I success I will close this issue then.@SetTrend commented on GitHub (Dec 14, 2018):
Works like a charm. Thanks!
@elgalu commented on GitHub (Jun 29, 2021):
Also setting
--ignorein a pre-commit works like a charm, e.g.