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
Add flags/options to set custom exit codes depending on the severity #7659
Comments
If you add |
This option doesn't suit me. I want my job to not crash with an error when stylelint ended with warning. What i want:
In GitLab CI this can be implemented using exit code. |
That sounds like a change that would break many scripts that assumes Adding 2 new flags that sets custom exit code for lint problems of severity error and warning could be a solution in the meantime. |
Adding the flags feature sounds like a cool solution that won't break anything. At the same time, it will solve my problem. |
@ybiquitous what's your take on this? |
@alSergey Just to clarify, you want a different exit code from $ stylelint error-and-warning.css
...
✖ 2 problems (1 error, 1 warning)
$ echo $?
2
$ stylelint warning.css
...
⚠ 1 problem (0 errors, 1 warning)
$ echo $?
0 #=> Do you want a different exit code here? |
@ybiquitous Yes, you got it right. I need this to do a warning job in GitLab CI. As @Mouvedia suggested, this can be done through the flag feature, then it won’t break anything. |
@alSergey Thanks for the answer. I understand your motivation. I was wondering if ESLint CLI had already provided a similar option (I couldn't find such an option in the ESLint doc). If you have the same problem with ESLint, can you please provide us with some information? |
The eslint cli also does not have this option, so I opened an issue for them. Let's see what they answer me there. |
Thanks for sharing the ESLint issue. I agree with seeing an ESLint team's answer. |
What is the problem you're trying to solve?
We have a fe stylelint job in GitLab CI that runs stylelint checks. Currently there is no way to show a warning in a job if stylelint ends with a warning.
What solution would you like to see?
Add a new exit code, which will be triggered if stylelint checks find 0 error and more than 0 warning.
The text was updated successfully, but these errors were encountered: