GithubHelp home page GithubHelp logo

Comments (10)

alSergey avatar alSergey commented on June 12, 2024 1

@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.

from stylelint.

alSergey avatar alSergey commented on June 12, 2024 1

The eslint cli also does not have this option, so I opened an issue for them. Let's see what they answer me there.

from stylelint.

Mouvedia avatar Mouvedia commented on June 12, 2024

If you add --max-warnings 0 it should exit 2 if you have 1 or more warnings.

from stylelint.

alSergey avatar alSergey commented on June 12, 2024

This option doesn't suit me. I want my job to not crash with an error when stylelint ended with warning. What i want:

  • stylelint command completed successfully (0 errors, 0 warnings) - job successful
  • stylelint command ended with warnings (0 errors, more than 0 warnings) - job warning
  • stylelint command ended with errors (more than 0 errors) - job errors

In GitLab CI this can be implemented using exit code.

from stylelint.

Mouvedia avatar Mouvedia commented on June 12, 2024

That sounds like a change that would break many scripts that assumes 2 for errors and --max-warnings.
It could possibly be done in the next major version.

Adding 2 new flags that sets custom exit code for lint problems of severity error and warning could be a solution in the meantime.
e.g. --lint-error-code 3, --lint-warning-code 4
It must fail if the custom code is one of the reserved ones.

from stylelint.

alSergey avatar alSergey commented on June 12, 2024

Adding the flags feature sounds like a cool solution that won't break anything. At the same time, it will solve my problem.

from stylelint.

Mouvedia avatar Mouvedia commented on June 12, 2024

@ybiquitous what's your take on this?
It seems like a legitimate request. Do you have proposals for the names?

from stylelint.

ybiquitous avatar ybiquitous commented on June 12, 2024

@alSergey Just to clarify, you want a different exit code from 0 if lint problems are only warning, right?

$ 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?

from stylelint.

ybiquitous avatar ybiquitous commented on June 12, 2024

@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?

from stylelint.

ybiquitous avatar ybiquitous commented on June 12, 2024

Thanks for sharing the ESLint issue. I agree with seeing an ESLint team's answer.

from stylelint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.