errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.3k stars 144 forks source link

How to apply Format-specific settings only to files that match a specific filename (i.e. a specific file pattern) #814

Closed krishnakumarg1984 closed 1 week ago

krishnakumarg1984 commented 2 months ago

Check for existing issues

Environment

Describe the bug / provide steps to reproduce it

I have the following .vale.ini config file in the root of my repository:

StylesPath = styles
MinAlertLevel = suggestion
Packages = proselint, write-good, alex, Readability, Joblint
Vocab = Base

[*]
BasedOnStyles = Vale, proselint, write-good, alex, Readability, Joblint

[README.md]
proselint.Annotations = NO
write-good.E-Prime = NO

I'd like to ignore the two specific issues but only in the README.md located at the root of my project. However, the above .vale.ini config i.e. with the [README.md] section heading, does not achieve this and vale continues to flag these issues in README.md. When we change the section heading to [*.md] it works fine, but that's the behavior I desire. How can we fix this?

jdkato commented 2 months ago

Do you see the same behavior when running Vale from the command line itself (i.e., not through neovim)?

ccoVeille commented 2 months ago

I'm also interested in this feature. I could apply different rules on my changelog.md files

AndrewMcFarlandCampbellNexeraID commented 3 weeks ago

I would find this useful, especially if it could be directory-based too, such as

[sdk/*.md]
jdkato commented 1 week ago

All of these cases should already be supported. As I mentioned in my comment above, my suspicion is that this issue is specific to neovim.

One thing to keep in mind is that it's likely editors are passing the absolute file path to Vale, meaning you may need to use a pattern like [**/README.md] or [**/sdk/*.md].