Open chris-rock opened 7 years ago
This is implemented in sass-lint https://github.com/sasstools/sass-lint/blob/240a148cba44abd7c784f72ae7839cdb9cc3be60/bin/sass-lint.js#L13-L17
@Snugug can you share you insights on this?
It doesn't seem to follow 'max-warnings': 0
in the gulp task options either.
I've tried to find some workarounds but this omission from the standard sass-lint behaviour makes the plugin pretty useless to me.
I'm better off using exec('sass-lint -v')
because it actually follows my config as expected
@DanPurdy Is there any guidance regarding this topic? I hesitate to open a new PR, just to get this closed again
Off the top of my head (i've not had the time to even look at sass-lint recently) it's because the gulp implementation is doing this on a file by file basis. If you were to reach the max errors in a single file you may see it work and then carry on linting the next file. Which is why the method @webdevian is showing is working as it'll handle it through the CLI.
I would guess that we'd need to incorporate some kind of collation of the results and then handle this separately. Trying to do that tidily without hitting the limit as I described above though might be a problem.
This is what I ended up using. I have my .sass-lint.yml max-warnings set to 0. I haven't tested it with setting that to any other value.
gulp.task('sass-lint', function(cb) {
exec('sass-lint -v', function(err, stdout) {
gutil.log(stdout);
cb(shouldItExitVar ? err : 0);
});
});
Either make this work or bring back the failOnWarning imho
Is this project now abandonware? Would be nice to get the ability to failOnWarning for our CI process.
The current release of gulp-sass-lint is not taking the option
max-warning
into account:Assume the following .sass-lint.yml
I run the test with sass-lint directly:
Now with gulp, using the same
.sass-lint.yml
:Please advice, how to proceed?