Comments (4)
@jdkato Hmm yeah just changing the return code seems like a bad idea.
How about a --warnings-as-errors
flag though? Similar to a -Werror
compile flag in some compilers. The issue with Vale's current behavior is that it makes it hard to detect the usage of MinAlertLevel = suggestion
in any way with tooling.
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.
from vale.
I think having something like a ExitCodeLevel = suggestion
setting would be useful in many situations. If a project needs or wants to strictly follow all of the rules in the RedHat
package, then they could use this setting in their CI/CD to block PRs/MRs until any violations are resolved. On personal projects a developer may prefer to err on the side of correctness and only disable individual rules as they encounter rules they disagree with. Relying on developers' eyes to catch issues, whether in their editor or in console output, is not a good idea and kinda goes against the whole purpose of linters. The primary value of linters is blocking the developer while they're still in the context in which they introduced the sub-optimal style or format because it's much easier to address such issues then than come back to them later.
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 ExitCodeLevel = suggestion
setting is elegant and solving the problem at the right level. I also wouldn't imagine it would be too difficult to implement given that Vale already exercises logic to make the exit code conditional on alert levels.
from vale.
I think Vale should exit with a non-zero exit code depending on
MinAlertLevel
.
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.
from vale.
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.
from vale.
Related Issues (20)
- Vale does not report the correct replacement term
- Mixing escaped parentheses and non-capturing groups in substitution rule leads to an error HOT 1
- The order of Vocab vs BasedOnStyles in a vale.ini affecting raw-scoped rules HOT 3
- Error while adding additional dictionaries
- How to apply Format-specific settings only to files that match a specific filename (i.e. a specific file pattern) HOT 2
- Docker image for 3.4.1 not available in dockerhub
- Ruby format treats interpolated strings as comments. HOT 4
- package severity level
- Vale can't find .ini in environment variable HOT 1
- Glob flag not working as expected
- `minalertlevel` via CLI HOT 1
- Provide a way to add exclusions to repetitions
- Uxpected behaviour with exceptions HOT 4
- npm package
- existence rule skips match in RST HOT 2
- Different rules for different file types? HOT 3
- How do I view spelling suggestions? HOT 1
- Incorrect suggestions with extends: substitution and ignorecase: true HOT 1
- Add a correct word marked as misspelled into a custom ignore file HOT 2
- Vale seems to switch mid file to consider code as markdown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vale.