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

CLI should provide a list of errors and exit with the appropriate exit code #221

Open
BPScott opened this issue Sep 25, 2015 · 7 comments
Open

Comments

@BPScott
Copy link

BPScott commented Sep 25, 2015

Using Sass-lint 1.2.2.

I'd like to use the CLI for my development workflow, running sass-lint to check quality. I'd like to:

  1. Get a list of issues in the CLI's output, so I can see an overview of all issues rather than having to fix them one at a time.
  2. Have sass-lint to exit with code 0 on success, and 1 if there are any errors.

Currently I can either:

  • Run sass-lint -v which throws an exception on the first error but does exit with code 1. This fails the first case but passes the second.
  • Run sass-lint -vq which provides a list of all errors, but always exits with code 0. This passes the first case but fails the second

Neither of which let me do what I'm hoping. I'm not sure what the best solution for this would be. Taking a quick look at eslint, when running it without options, they output the full list of issues every time, if sass-lint were to mimic this then the default action would be akin to currently running sass-lint -qv, but also providing the proper exit code.

@DanPurdy
Copy link
Member

Hey @BPScott so I've definitely got this in mind right now.. Once I've finished writing the rules that I have left on my plate this will be my next focus.

I completely agree that proper error codes need to be implemented soon and functionality should mimic to a point other successful linters, I think our main focus at the moment is getting our rules and our original goal of supporting both the scss and Sass syntax sorted and then we're looking into improving functionality. We are well on our way though!

@BPScott
Copy link
Author

BPScott commented Sep 25, 2015

Hi @DanPurdy, indeed it's amazing to see sass-lint hurtling along at such a great pace. Figured I'd raise an issue just to make sure this doesn't get lost down the sofa tracked. Totally agree that beefing out the ruleset is top priority :)

@DanPurdy
Copy link
Member

Ha thanks @BPScott we'll try and keep the pace up! 😄

@bquorning
Copy link
Contributor

I’m using this shell script as a work-around until sass-lint have proper exit status codes:

SASS_LINT_OUTPUT=$(node_modules/.bin/sass-lint -v)

if [ -n "$SASS_LINT_OUTPUT" ]; then
  echo "$SASS_LINT_OUTPUT"
  exit 1
fi

@kmiyashiro
Copy link

This should be closed, it was fixed in #458

@glen-84
Copy link
Contributor

glen-84 commented Feb 18, 2017

@kmiyashiro,

This doesn't fully solve the issues raised there as I believe we should be supporting a range of different error codes but this for now solves the main problem that's been reported.

@mvz
Copy link

mvz commented Dec 23, 2017

@kmiyashiro also sass-lint doesn't provide the list of errors when run without arguments?

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

No branches or pull requests

7 participants