-
Notifications
You must be signed in to change notification settings - Fork 532
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
Return parse errors as lint errors #459
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
Damn you coveralls! 😛 I'll add some non cli unit tests too later on to check the results. |
Oops, just had a moment there.. |
Looks good - will solve one of the major gripes at the mo. |
bgriffith
added a commit
that referenced
this pull request
Jan 20, 2016
Return parse errors as lint errors
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In an effort to reduce the amount of unhandled errors thrown by
sass-lint
I've converted the parse errors and undefined tree errors that can be thrown while the AST is being constructed into lint errors.Firstly this prevents AST bugs from crashing peoples linting builds altogether and only prevents the file with the parse error from being linted rather than the whole project.
Secondly as the line is reported directly as a parse error it should allow people to provide a more useful bug report in the event of something un expected happening rather than them having to be confronted with a meaningless stack trace at the moment.
I've gone with the Eslint report style in the sense that the ruleId reported for these errors is
Fatal
.There's not a specific issue that this relates to for
sass-lint
other than my desire to remove all thrown errors as best as possible but it does relate to many issues encountered ingulp-sass-lint
andgrunt-sass-lint
etc#18 for example.
Errors thrown by failing rules will still be thrown as errors for now as they do break the lint cycle.
Not the cleanest implementation right now but I figure this will be a big consideration once we move to v2.0.
Also added a few tests to the CLI to ensure these errors are reported correctly.
DCO 1.1 Signed-off-by: Dan Purdy danjpurdy@gmail.com