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

How to get Grunt not to fail the whole task if only warnings but no errors were found #128

Open
LorenzKahl opened this issue Dec 30, 2015 · 6 comments

Comments

@LorenzKahl
Copy link

When running my scss-lint task I get some warnings but no errors and the following output:

Warning: Task "scsslint:allFiles" failed. Use --force to continue.
Error: Task "scsslint:allFiles" failed.
    at Task.<anonymous> (/<path>/node_modules/grunt/lib/util/task.js:205:15)
    at null._onTimeout (/<path>/node_modules/grunt/lib/util/task.js:241:33)
    at Timer.listOnTimeout (timers.js:119:15)

I already had a look at https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/cli.rb
So, as of my understanding the exit code of the scss-lint gem would be 1.

I would like Grunt to continue if there are no errors. Any advice on how to achieve this?

My Grunt task looks like this:

...
scsslint: {
    allFiles: scssFilePattern,
    options: {
        config: '.scss-lint.yml',
        colorizeOutput: true,
        emitError: false,
        compact: false,
    },
}, // end of scsslint
...
@ahmednuaman
Copy link
Owner

Run the task with --stack --debug please.

@LorenzKahl
Copy link
Author

Thanks, but the relevant output is the same.

@LorenzKahl
Copy link
Author

Here's an abbreviated version of the output – I deliberately left out all the linter-warnings.

$ grunt scsslint --stack --debug
Running "scsslint:allFiles" (scsslint) task
[D] Task source: /<projectpath>/node_modules/grunt-scss-lint/tasks/scss-lint.js
Running scss-lint on allFiles
[D] Run command: scss-lint -c .scss-lint.yml _global_css/_scss/_c-tp-checklist.scss _global_css/_scss/_c-tp-copytext.scss _global_css/_scss/_c-tp-downloadbutton.scss _global_css/_scss/_c-tp-easylist.scss _global_css/_scss/_c-tp-fleximage.scss _global_css/_scss/_c-tp-footnotelist.scss _global_css/_scss/_c-tp-formelement.scss _global_css/_scss/_c-tp-headline.scss _global_css/_scss/_c-tp-message.scss _global_css/_scss/_c-tp-orderedlist.scss _global_css/_scss/_c-tp-separatorline.scss 
...
<a lot of other linter-warnings> 
...
_global_css/_scss/_m-tp-textblock.scss:90 [W] TrailingZero: `1.500` should be written without a trailing zero as `1.50`
Warning: Task "scsslint:allFiles" failed. Use --force to continue.
Error: Task "scsslint:allFiles" failed.
    at Task.<anonymous> (/<projectpath>/node_modules/grunt/lib/util/task.js:205:15)
    at null._onTimeout (/<projectpath>/node_modules/grunt/lib/util/task.js:241:33)
    at Timer.listOnTimeout (timers.js:119:15)

@ahmednuaman
Copy link
Owner

Any progress?

@nick11703
Copy link
Contributor

@LorenzKahl I think PR #138 will help with this.

@LorenzKahl
Copy link
Author

@nick11703 great - I will have a look. Thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants