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

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

Open
scic opened this issue Feb 3, 2016 · 17 comments
Open

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

scic opened this issue Feb 3, 2016 · 17 comments
Labels

Comments

@scic
Copy link

scic commented Feb 3, 2016

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
Copy link

👍

@mattgreenfield
Copy link

Yes, this would be great to get fixed. Thanks

@JockVanDallas
Copy link

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

@lalarsson
Copy link

I've got the same issue.

@lqc
Copy link

lqc commented May 31, 2016

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

@mogusbi
Copy link

mogusbi commented Sep 23, 2016

Has there been any progress with this?

@DanPurdy
Copy link
Member

DanPurdy commented Nov 7, 2016

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

@DanPurdy DanPurdy closed this as completed Nov 7, 2016
@JockVanDallas
Copy link

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

@DanPurdy
Copy link
Member

DanPurdy commented Dec 4, 2016

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

@SKempin
Copy link

SKempin commented Dec 9, 2016

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

@DanPurdy DanPurdy reopened this Dec 9, 2016
@JockVanDallas
Copy link

I use

  • gulp-sass-lint 1.3.2
  • gulp 3.9.1
  • sass-lint 1.10.2

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
Copy link
Member

DanPurdy commented Dec 9, 2016

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
Copy link

SKempin commented Dec 9, 2016

@DanPurdy Thanks, that has done it for me.

@JockVanDallas
Copy link

@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
Copy link

ghost commented May 17, 2017

This is still a persisting error...

@raptor235
Copy link

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

@chaance
Copy link

chaance commented Jan 15, 2020

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

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

No branches or pull requests