sasstools / gulp-sass-lint

Gulp plugin for Sass Lint
MIT License
115 stars 43 forks source link

Setting option output-file overwrites file for each processed file #27

Open scic opened 8 years ago

scic commented 8 years ago

I call it like this:

gulp.src(path.join(options.src, '/app/**/*.scss'))
  .pipe($.sassLint({
    options: {
      formatter: 'checkstyle',
      'output-file': 'checkstyle-scss.xml'
    }
  }))
  .pipe($.sassLint.format());

If there are errors in multiple files now the output-file gets written for each erroneous file. The following output can be observed for each file with errors:

Output successfully written to checkstyle-scss.xml
Output successfully written to checkstyle-scss.xml
Output successfully written to checkstyle-scss.xml
Output successfully written to checkstyle-scss.xml

The output for previous files is lost.

Expected: The output of each file is concatenated in the resulting file.

gregoire-jianda commented 8 years ago

:+1:

mattgreenfield commented 8 years ago

Yes, this would be great to get fixed. Thanks

JockVanDallas commented 8 years ago

same issue here, would be really nice to concatenate to the output-file. Now it is mostly useless

lalarsson commented 8 years ago

I've got the same issue.

lqc commented 8 years ago

I wouldn't call this an enhancement, as already mentioned, the output right now is pretty useless from a CI server perspective.

mogusbi commented 7 years ago

Has there been any progress with this?

DanPurdy commented 7 years ago

This should be fixed in v1.3.0 which I just released. If you have any issues please let me know.

JockVanDallas commented 7 years ago

I am using gulp-sass-lint 1.3.2 and this is still an issue. I tried different formatters, same problem.

DanPurdy commented 7 years ago

@JockVanDallas can you open a new issue please and leave some details to what you tried and your config etc please 👍

SKempin commented 7 years ago

@JockVanDallas @DanPurdy I'm also using 1.3.2, and this is still an issue.

JockVanDallas commented 7 years ago

I use

This is my gulp task with configuration

return gulp.src(['www-src/sass/**/**/*.scss', '!www-src/sass/shared/plugins/*.scss'])
        .pipe(plugins.sasslint({
            options: {
                formatter: 'junit',
                'output-file': 'reports/sasslint.xml'
            }
        }))
        .pipe(plugins.sasslint.format())
        .pipe(plugins.sasslint.failOnError());
DanPurdy commented 7 years ago

If you follow the instructions about writing to a file using gulp instead of sass-lint https://github.com/sasstools/gulp-sass-lint#sasslintformatwritable do you get the same issues?

Otherwise the issue would lie in Sass-lint itself I believe. I'll have a little look into this when i get some time though.

For now I believe you could adjust your gulp config to 'make this work'

SKempin commented 7 years ago

@DanPurdy Thanks, that has done it for me.

JockVanDallas commented 7 years ago

@DanPurdy When i use gulp for writing to a file as you described here https://github.com/sasstools/gulp-sass-lint#sasslintformatwritable the results are now added to the file instead of overwriting the previous ones, but it starts a new xml doc for every sass file being linted.

This is the new output:

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
</testsuites>
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
</testsuites>
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
</testsuites>
ETC.......

and i would expect it only once

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
</testsuites>

All warnings and errors are logged into the report file but my Jenkins is failing to read this report.xml because of this, so it is still useless to use it in a CI/CD environment

ghost commented 7 years ago

This is still a persisting error...

raptor235 commented 4 years ago

Is development on this library dead? issue has been around for close to 3 years... any alternatives out there we can use?

chaance commented 4 years ago

Sass lint has been kind of lingering in no-man's land for a while. I'd take another look at stylelint and see if it fits your needs until (or if) development here picks back up. Stylelint has gotten a lot better with Sass over the years and has a gulp plugin just as well. https://www.npmjs.com/package/gulp-stylelint