-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Treat grammar warnings as non-fatal #5497
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We have a very long list of outstanding grammar issues in #3924 which isn't getting much smaller, mostly because of the number of non-fatal issues that really aren't much of an issue. This output is what is produced when I update the grammars with each release and it makes it really hard to spot new legitimate issues.
This PR addresses one of @Alhadis's longest requests:
If a contributor attempts to add or replace a grammar with legitimate errors, they get a failure as before:
Example output for adding/replacing grammar with fatal errors
If they attempt to add or replace a grammar with only warnings, they don't get a failure, but they do get a warning:
Example output for adding/replacing grammar with non-fatal warnings
I've also hidden these warnings by default when updating/compiling all the grammars:
Example output for updating/compiling all grammars
This smaller output will be what is used to continue to track problems with the grammars in #3924 .
These warnings can however be revealed with the
-v
flag:Example verbose output for updating/compiling all grammars
I've kept the ability to view these warnings for situations where a grammar author may question why the syntax highlighting on GitHub.com doesn't match what they see in something like VS Code.
As part of this PR, I've also converted the compiler to using Go modules, updated the build env for it, and updated
urfave/cli
to v2 so we can take advantage of default values which needed a few other tweaks due to a change in the API.I'll update the Docker container used to compile the grammars once this PR has been merged.
Checklist:
The compiler needs a lot more tests, but that's an effort for another day.