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

Update to error codes #458

Merged
merged 7 commits into from
Jan 28, 2016
Merged

Conversation

DanPurdy
Copy link
Member

As discussed in #221 when errors are detected from the CLI there is an inconsistent error code being thrown.

This doesn't fully solve the issues raised there as I believe we should be supporting a range of different error codes but this for now solves the main problem that's been reported.

Took the opportunity to improve comments and structure within the main index file too.

If any errors are detected now the CLI will always exit with a error code of 1 even if errors are supressed with the --quiet flag, warnings will still return a code of 0.

@BPScott you may want to double check this meets your requirements?

DCO 1.1 Signed-off-by: Dan Purdy [email protected]

@DanPurdy
Copy link
Member Author

node v0.10.x has an issue with child process it seems where if an unhandled error is detected (i.e. the ones we throw with error counts in them if not set to --no-exit) it throws an error code of 8, I've verified that error code 1 is still output when not in a child process, unless we want a test case that check for ode versions too ive had to remove the error code test for non quiet output.

@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/error-codes branch December 23, 2015 22:14
@DanPurdy DanPurdy restored the feature/error-codes branch December 23, 2015 22:15
@DanPurdy DanPurdy deleted the feature/error-codes branch December 23, 2015 22:15
@DanPurdy DanPurdy restored the feature/error-codes branch December 23, 2015 22:15
@DanPurdy DanPurdy reopened this Dec 23, 2015
@DanPurdy
Copy link
Member Author

@bgriffith I went back and double checked this. The idea was to make sure that an exit code of 1 was thrown when the --no-exit flag was set on the CLI.

Currently even if errors are detected an exit code of 0 is thrown when set to --no-exit this is causing problems for those who use this as a CI tool as it will report their builds as passing when in fact errors are present.

Warnings still display with a code of 0

You can test this out yourself if you would like, go into the sass-lint directory and run
sass-lint --config tests/yml/.error-output.yml tests/sass/id-name-format.scss --verbose --no-exit
or
sass-lint --config tests/yml/.error-output.yml tests/sass/id-name-format.scss --verbose -q

then once you see the output in bash, type echo $? which will show you the last exit code.

👍

I would say it's good to merge if this passes code review.

@bgriffith
Copy link
Member

Looks good! Tests worked!

bgriffith added a commit that referenced this pull request Jan 28, 2016
@bgriffith bgriffith merged commit 42a1fdc into sasstools:develop Jan 28, 2016
@DanPurdy DanPurdy deleted the feature/error-codes 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