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

SCSSLint::Linter::Comment - Length must be more than 0, passed -38 #887

Closed
gpoul opened this issue Feb 10, 2017 · 4 comments
Closed

SCSSLint::Linter::Comment - Length must be more than 0, passed -38 #887

gpoul opened this issue Feb 10, 2017 · 4 comments
Labels

Comments

@gpoul
Copy link

gpoul commented Feb 10, 2017

linting this:

@mixin make-grid($class) {
  @if ($class == "lg")
    { $grid-columns-lpo: $grid-columns + 3;  } /*sev */
}

results in this:

SCSSLint::Linter::Comment raised unexpected error linting file repro.scss: 'Length must be more than 0, passed -38'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/location.rb:14:in `initialize'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:78:in `new'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:78:in `location_from_range'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:173:in `extract_location'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:61:in `add_lint'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter/comment.rb:7:in `visit_comment'
/home/gpoul/.gem/ruby/2.1.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:139:in `visit'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:150:in `block in visit_children'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:148:in `each'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:148:in `visit_children'
/home/gpoul/.gem/ruby/2.1.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:38:in `visit'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:139:in `visit'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:150:in `block in visit_children'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:148:in `each'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:148:in `visit_children'
/home/gpoul/.gem/ruby/2.1.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:38:in `visit'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:139:in `visit'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/linter.rb:41:in `run'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:53:in `run_linter'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:35:in `block in find_lints'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:33:in `each'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:33:in `find_lints'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:19:in `block in run'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:18:in `each'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/runner.rb:18:in `run'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/cli.rb:67:in `scan_for_lints'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/cli.rb:59:in `act_on_options'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/lib/scss_lint/cli.rb:33:in `run'
/home/gpoul/.gem/ruby/2.1.0/gems/scss_lint-0.52.0/bin/scss-lint:7:in `<top (required)>'
/home/gpoul/.gem/ruby/2.1.0/bin/scss-lint:23:in `load'
/home/gpoul/.gem/ruby/2.1.0/bin/scss-lint:23:in `<main>'
Report this bug at https://github.com/brigade/scss-lint/issues
 
To help fix this issue, please include:
- The above stack trace
- SCSS-Lint version: 0.52.0
- Sass version: 3.4.23
- Ruby version: 2.1.5
@trotzig
Copy link
Contributor

trotzig commented Feb 10, 2017

Ouch. Can you help narrow this down by perhaps reformatting that if-statement a little and see if there is any change?

@trotzig trotzig added the bug label Feb 10, 2017
@gpoul
Copy link
Author

gpoul commented Feb 10, 2017

@trotzig what I found was that this goes away as soon as you add a new line after the /* but simply inserting a blank doesn't fix it.

@trotzig
Copy link
Contributor

trotzig commented Feb 14, 2017

Okay, good to know.

I don't have much time to focus on this now, so if you want to take a stab at it, I'd be happy for a PR.

@srawlins
Copy link
Contributor

srawlins commented May 7, 2017

This is caused by sass/sass#2284. I wouldn't wait on a fix, but we can work around it in scss-lint.

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

3 participants