-
Notifications
You must be signed in to change notification settings - Fork 533
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
Return empty json array when Sass-Lint runs successfully but finds no issues. #658
Comments
We can definitely look to do this, unfortunately your PR didn't cater for the majority of users who don't use output files for their results. To implement you'd need to make sure the user has chosen to output the results to a file first and then check if the results are empty or not. Also with the different formatters we use it couldn't just be JSON format if for example the user has html output.. Sass-lint always throws error or exit codes so you can check for those and also if your task is setup then the lack of an output file would indicate your linting was fine? Or is there a worry that Sass-lint may not have run for you? |
Also there were specific steps taken to silence the output on the event of no warnings/errors before #141 so I'm not sure whether this would contradict that. @sasstools/sass-lint-contributors thoughts? |
I just have a specific use case where I need it to write out an empty JSON array to the ouput file. What is the exit code if the linter actually fails to run as opposed to if it finds errors? |
I was looking into this as well. I was going to submit a PR that would remove the Line 264 in fbaf738
I just spent a fair amount of time trying to debug why ignoring a file was still showing a warning in the output, before I realized that the output was never being updated. It wasn't being updated because all the warnings/errors were addressed. Some sort of feedback that there were 0 errors would have prevented my witch hunt. I'd love to contribute, if you all believe consistent outputting would be a worthwhile feature. I definitely believe it is. |
@tommycoppers that's an interesting occurrence, I can see both sides of the argument. Maybe it's a case that output files should still be written but the console should remain silent on no errors. This wouldn't be hard to implement at all in the area you highlighted, I'd be happy to get PR's for this if you feel it's the way to go or we can discuss a better approach? Thanks |
Is it possible to do this? Otherwise I don't know if sass-lint has run or not as it won't create an empty output file.
The text was updated successfully, but these errors were encountered: