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 output inconsistency - Use only col instead of col/char/character. #89

Closed
oryband opened this issue Jun 26, 2011 · 3 comments
Closed
Labels
Milestone

Comments

@oryband
Copy link

oryband commented Jun 26, 2011

Relates to #87, #88.

  1. Each error message reports the line & columns position, using the line and col strings before printing the number.
  2. In addition, error messages also print line & column position in the second line, while warnings do not.
    1. This line's line & column position use the word char and sometimes character instead of col, with no logical explanation for this behaviour.

column is the same as character semantic-wise, why use different words in different parts of the output? Either use column, col, character, or char, but not all of them together.

In short:

  1. There is no need to print line & column position in the error description, since they are printed at the first line of each error message.
  2. Use col only, no column, char, character, etc.

Example, with my comments after each <---:

~/example/css$ csslint example.css


csslint: There are 110 errors and 236 warnings in /Users/ory/example/css/example.css.

...

/Users/example/css/example.css
27: error at line 153, col 1 <--- OK.
Unexpected token '@' at line 153, char 1. <--- Remove `at line 153, char`. Print only `Unexpected token '@'.`
@-webkit-keyframes glow {

/Users/example/css/example.css
28: error at line 154, col 14 <--- OK.
Expected COLON at line 154, character 14. <--- Remove `at line 153, character`. Print only `Expected COLON.`
        from {

/Users/example/css/example.css
344: warning at line 491, col 13 <--- OK.
Element (span.class_b) is overqualified, just use .class_b without element name. <--- OK.
.class_a span.class_b {

...
@nzakas
Copy link
Contributor

nzakas commented Jun 27, 2011

The issue you're pointing out occurs when the parser returns a syntax error vs. when the linter reports a warning. The parser always returns line/col information when an error occurs, and since it can be used in many places other than CSS Lint, it wouldn't make sense to change the parser to not do that (since this is important information). I can see about formatting the message output to strip it out.

@oryband
Copy link
Author

oryband commented Jun 27, 2011

It's more of a request than an issue.

The output should be consistent, just like every other syntax-checker's output. See #88 for an example of JSHint, which is the same as Crockford's JSLint.

As I said before in that other issue, this is targeted towards making it easy for programs to parse the output. The results are eventually printed into IDEs' error windows.

@oryband
Copy link
Author

oryband commented Jul 1, 2011

@nzakas: OK, so if the parser prints line & column as line & char, than make all the column prints i.e. col & column to be printed as char instead.

Just make it consistent throughout all prints.

@nzakas nzakas closed this as completed in 9eb2cfd Jul 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants