You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I configured Vale using pre-commit in a repo, and thought I had fixed everything once pre-commit stopped reporting issues. But as it turns out:
pre-commit hides output for successful hooks when run without --verbose. This is a reasonable default to avoid noise from linters not following the "no output means everything's good" guideline.
vale only returns a non-zero exit code on errors, not on MinAlertLevel and higher levels.
This was surprising, since I expected that if anything is alerted, there should be a non-zero exit code.
As for the implementation, changing MinAlertLevel to also control the exit code changes the semantics, which would necessitate a new version. On the other hand, adding a separate MinAlertLevelControlsExitCode flag or MinExitCodeLevel option (with the same possible values as MinAlertLevel and defaulting to error) is additional complexity.
The solution suggested in #575 seems to require kinda clunky implementation (based on this):
vale "$@"| awk 'BEGIN {status = 1} 1; END {if(/^✔/) status = 0; exit(status)}'
The text was updated successfully, but these errors were encountered:
Check for existing issues
Describe the feature
I configured Vale using pre-commit in a repo, and thought I had fixed everything once
pre-commit
stopped reporting issues. But as it turns out:pre-commit
hides output for successful hooks when run without--verbose
. This is a reasonable default to avoid noise from linters not following the "no output means everything's good" guideline.vale
only returns a non-zero exit code on errors, not onMinAlertLevel
and higher levels.This was surprising, since I expected that if anything is alerted, there should be a non-zero exit code.
As for the implementation, changing
MinAlertLevel
to also control the exit code changes the semantics, which would necessitate a new version. On the other hand, adding a separateMinAlertLevelControlsExitCode
flag orMinExitCodeLevel
option (with the same possible values asMinAlertLevel
and defaulting toerror
) is additional complexity.The solution suggested in #575 seems to require kinda clunky implementation (based on this):
The text was updated successfully, but these errors were encountered: