Skip to content
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

[Question] Issue with ignoring files #403

Closed
Stanzilla opened this issue Feb 3, 2022 · 6 comments
Closed

[Question] Issue with ignoring files #403

Stanzilla opened this issue Feb 3, 2022 · 6 comments

Comments

@Stanzilla
Copy link

  • OS (e.g., macOS, Windows, Linux, etc.) - Linux
  • Install method (e.g., Go, Homebrew, direct download, etc.) - Homebrew
  • Vale version (the result of vale -v) - 2.14

I'm trying to use on vale on *.md files but not on *.fr.md and I can't seem to be able to do that?

[*.fr.md]
Google.Exclamation = NO
Google.Spelling = NO

is what I tried.

@jdkato
Copy link
Member

jdkato commented Feb 3, 2022

This should work:

[*.fr.md]
Google.Exclamation = NO
Google.Spelling = NO

[*.md]
BasedOnStyles = Google

You can also filter the *.fr.md files from the command line: $ vale --glob='!*.fr.md' ..

See #245 for a related discussion.

@Stanzilla
Copy link
Author

Stanzilla commented Feb 3, 2022

This should work:

[*.fr.md]
Google.Exclamation = NO
Google.Spelling = NO

[*.md]
BasedOnStyles = Google

You can also filter the *.fr.md files from the command line: $ vale --glob='!*.fr.md' ..

See #245 for a related discussion.

image
Sadly does not work here

The cli method does but I'd rather have it in the config.

Here is my whole config:

# Vale configuration for the Core Games documentation
# https://errata-ai.github.io/vale/

# Core properties
#----------------
# Specify where to find styles
StylesPath = .github/vale-styles
Vocab = Manticore

# Specify the minimum alert level to report
# Alerts are assigned a level of suggestion, warning, or error.
# For local use it's good to see all the suggestions and warnings.
MinAlertLevel = warning

# Specify how to test a particular type of files
#-----------------------------------------------

[*.fr.md]

Google.Exclamation = NO
Google.Spelling = NO
Google.Headings = NO
Google.Colons = NO
Google.Quotes = NO
Google.FirstPerson = NO
Google.Ellipses = NO

[*.md]

# Vale comes with three built-in styles: write-good, proselint, and Joblint.
# You could enable all rules in the "Google" style guide as follows:
BasedOnStyles = Google

# Initially, we only want to run a few rules, so we'll specify them individually
# Style.Rule = {YES, NO} to enable or disable a specific rule

Google.Spacing = NO ; too many false positives
Google.Ordinal = NO
Google.Quotes = NO
Google.Units = YES
Google.OptionalPlurals = YES
Google.Slang = YES
Google.We = NO ; disable but long term enable
Google.Headings = NO
Google.WordList = NO ; warn `above`, reference sections by name
Google.Will = NO
Google.Ellipses = NO
Google.Colons = NO
Google.FirstPerson = NO
Google.Ranges = YES
Google.OxfordComma = YES

# Modify the level of some rules
Google.Exclamation = warning

# Suggestions
Google.Acronyms = YES
Google.Contractions = NO
Google.Parens = NO
Google.Passive = NO
Google.Semicolons = NO

# Manticore rules
Manticore.FirstPerson = YES

Edit: Nevermind, I understood the scoping now, I have to use BasedOnStyles = Google in both sections and then just disable everything in the first. Thank you!

@jdkato
Copy link
Member

jdkato commented Feb 3, 2022

I think there may actual be a bug here: it seems like the results are nondeterministic between runs.

@Stanzilla
Copy link
Author

I think there may actual be a bug here: it seems like the results are nondeterministic between runs.

I was just about to post that, got me confused for a second when I got different results between runs

@jdkato
Copy link
Member

jdkato commented Feb 8, 2022

This should be fixed in the latest release.

However, for cases where a given file could match more than one section (e.g., foo.fr.md matches both *.md and *.fr.md), overrides will be applied in a cascading fashion -- so, you'll want to apply the fr overrides after the md section:

[*.md]
BasedOnStyles = Google

[*.fr.md]
Google.Exclamation = NO
Google.Spelling = NO

@Stanzilla
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants