-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Pre-commit hooks don't error out on warnings/suggestions #575
Comments
This would break the ability to report multiple levels but only fail on errors (which is common use case). The current solution here is to change the severity of rules that you want to result in a non-zero exit code: [*]
BasedOnStyles = SomeStyle
SomeStyle.Rule = error I get that this could be a pain if you want every rule to be an error, but I think that's generally not a good idea because sub-error rules are often that way for a reason. |
@jdkato Hmm yeah just changing the return code seems like a bad idea. How about a Even with that flag on, if Vale is run through pre-commit hooks, it doesn't report anything. Users would have to know that Vale is part of the hooks and manually run them in verbose mode to see warnings and suggestions. |
I'd say the "recommend" solution here is to use one of Vale's editor extensions, so that users can make decisions about suggestions/warnings as they're writing. It's quite possible that you want to ignore some of these and therefore wouldn't want it to block a commit. |
I think having something like a Without such a setting, developers or projects wanting strict enforcement would have to add a per-rule setting for every rule which is quite onerous given the number of rules in a package, let alone multiple packages. Those lists will also then become out of date with the packages over time. As such, they would probably have to add some external automated build process to generate Vale configurations from package rules. This is pretty ugly whereas something like a |
Add a script to set the alert level for all rules to `error` to workaround [the lack of support in Vale for specifying which alert levels should exit with a non-zero status](errata-ai/vale#575 (comment)).
Running the pre-commit hooks with a
.vale.ini
containingwon't fail when only warning and suggestion alerts are raised.
As long as no errors are reported vale exits with code 0. Pre-commit hooks will only fail if the tool exits with a non-zero exit code. The current behavior can be checked with:
I think Vale should exit with a non-zero exit code depending on
MinAlertLevel
.The text was updated successfully, but these errors were encountered: