-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
[Feature Request] Ignore files specified in .gitignore
#292
Comments
You've read my thoughts in #1 so I won't repeat them here - though they remain valid and need to be addressed. You reference the behavior of prettier, but it uses a dedicated configuration file (not .gitignore) and similar functionality is already possible with this tool via .markdownlint-cli2.jsonc and the globs parameter. What are some examples of common directories that appear in .gitignore and contain Markdown files? In my experience, there is typically just one directory like node_modules, vendor, etc. which is straightforward to handle. |
Prettier ignores all files/folders that are in root directories {
"name": "acme/hello-world",
"require": {
"laravel/laravel": "*"
}
}
Running However,
Yeah, it is clear to me that it is possible to implement arbitrary matching rules . However, what I'm asking/suggesting is a merely a user experience change. Right now, users have to write a markdownlint-cli2 config file to reasonably use the tool. I think it's more inviting if users may write a config file to customise the behaviour of the tool to their needs. Another way of saying is the following: From the discussion in #1 it sounded like it would be easy to implement this, if we limit ourselves to root ignore file(s) only (bear with me, if I misunderstood the point). I (personally) think the UX gain from
is huge. And outweighs the downside of not being able to properly adhere to cascading ignore files (which are not gitignored anyways 😂 ).
I can only speak for languages I'm familiar with
But I'm sure most languages will have their own specific folders. |
No. Per the documentation and example: I'll leave this issue open for consideration for the next version. I need to revisit my previous comments and the options that are available nowadays. You propose enabling this behavior by default and .gitignore files are common, so it's important to me to make sure the performance impact is as small as possible. Nobody is using this feature today, but adding it will making everyone's experience slower. |
It looks like |
Description:
Make it possible for users to configure
markdownlint-cli2
to ignore all files from.gitignore
.It could either be the default behaviour (which I personally find reasonable) but could also be a configurable option.
Use case:
It is quite common for repositories to generate files and folder which are external dependencies and where the repository owner do not have control over. Generally, people would add these to
.gitignore
file. For examplenode_modules
orvendor
.Currently, when adding Markdownlint (via
markdownlint-cli
) to an existing repository users are overwhelmed with a lot of false-positives from gitignore'd directories. To circumvent, users have to configuremarkdownlint-cli
accordingly, essentially, re-implementing their gitignore file again.Further information:
.gitignore
file from the current working directory (the directorymarkdownlint-cli2
is getting called from) is considered. This is similar behaviour like Prettier (see https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore) and it feels quite intuitive.The text was updated successfully, but these errors were encountered: