SimenB / stylint

Improve your Stylus code with Stylint
https://simenb.github.io/stylint/
GNU General Public License v2.0
348 stars 62 forks source link

Return correct error code after execution #336

Closed danijeld closed 7 years ago

danijeld commented 8 years ago

Can we please have stylint return 0 if no errors are found and 1 if errors are found after it executes?

SimenB commented 8 years ago

It should already: https://github.com/rossPatton/stylint/commit/aa0e1890b4a69b39d93591e036eb38cb23263208#diff-6081bb8ff8dbece71ba61504af4ec274

What version are you using?

danijeld commented 8 years ago

Stylint version: 1.5.6

Here is a list of commands I ran to validate this.

File without issues:

vagrant@vagrant-ubuntu-trusty-64:$ stylint src/ vagrant@vagrant-ubuntu-trusty-64:$ echo $? 0

After introducing errors: vagrant@vagrant-ubuntu-trusty-64:$ stylint src/ src/views/Settings/settings.styl 48:7 warning property is not valid valid

Stylint: 0 Errors. Stylint: 1 Warnings. vagrant@vagrant-ubuntu-trusty-64:$ echo $? 0

It always returns 0.

SimenB commented 8 years ago

If maxErrors is set, the amount must be more than that. You example has a warning, and unless maxWarnings is set, warnings will always exit cleanly. See the logic in getExitCode from the diff I pasted in my last commnet

SimenB commented 7 years ago

@danijeld Closing this, please ping me if you still have an issue with this.