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

max-warnings is not reflected in gulp-sass-lint #73

Open
chris-rock opened this issue Jan 24, 2017 · 9 comments
Open

max-warnings is not reflected in gulp-sass-lint #73

chris-rock opened this issue Jan 24, 2017 · 9 comments

Comments

@chris-rock
Copy link

The current release of gulp-sass-lint is not taking the option max-warning into account:

Assume the following .sass-lint.yml

options:
  max-warnings: 0

I run the test with sass-lint directly:

$sass-lint  -v -q -c .sass-lint.yml elements/**/*.scss

report/report.scss
  7:3  warning  Expected `display`, found `font-family`  property-sort-order

✖ 1 problem (0 errors, 1 warning)

$ echo $?                                                             
1

Now with gulp, using the same .sass-lint.yml:

$ gulp sasslint
[14:22:22] Using gulpfile ~/report/gulpfile.js
[14:22:22] Starting 'sasslint'...
[14:22:22] Finished 'sasslint' after 9.16 ms

report/report.scss
  7:3  warning  Expected `display`, found `font-family`  property-sort-order

✖ 1 problem (0 errors, 1 warning)

$ echo $?      
0

Please advice, how to proceed?

@chris-rock
Copy link
Author

@chris-rock
Copy link
Author

@Snugug can you share you insights on this?

@webdevian
Copy link

It doesn't seem to follow 'max-warnings': 0 in the gulp task options either.

@webdevian
Copy link

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

@chris-rock
Copy link
Author

@DanPurdy Is there any guidance regarding this topic? I hesitate to open a new PR, just to get this closed again

@DanPurdy
Copy link
Member

DanPurdy commented Jan 30, 2017

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.

@webdevian
Copy link

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);
  });
});

@Gidmark
Copy link

Gidmark commented Sep 13, 2017

Either make this work or bring back the failOnWarning imho

molsm added a commit to molsm/gulp-sass-lint that referenced this issue Feb 24, 2019
molsm added a commit to molsm/gulp-sass-lint that referenced this issue Feb 24, 2019
@gconry18
Copy link

gconry18 commented Dec 9, 2019

Is this project now abandonware? Would be nice to get the ability to failOnWarning for our CI process.

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

5 participants