Skip to content
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 6 commits into from
Jan 20, 2016

Conversation

DanPurdy
Copy link
Member

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 in gulp-sass-lint and grunt-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

@DanPurdy
Copy link
Member Author

Damn you coveralls! 😛

I'll add some non cli unit tests too later on to check the results.

@DanPurdy DanPurdy added this to the 1.5.0 milestone Dec 21, 2015
@DanPurdy DanPurdy mentioned this pull request Dec 21, 2015
6 tasks
@DanPurdy DanPurdy closed this Dec 23, 2015
@DanPurdy DanPurdy deleted the feature/parse-errors branch December 23, 2015 22:15
@DanPurdy DanPurdy restored the feature/parse-errors branch December 23, 2015 22:15
@DanPurdy DanPurdy reopened this Dec 23, 2015
@DanPurdy
Copy link
Member Author

Oops, just had a moment there..

@bgriffith
Copy link
Member

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
@bgriffith bgriffith merged commit ea57289 into sasstools:develop Jan 20, 2016
@DanPurdy DanPurdy deleted the feature/parse-errors branch April 22, 2016 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants