scss-lint
scss-lint copied to clipboard
Single control comment does not work in at least one edge case
I have replicated a bug I saw in my own project in the test suite: https://github.com/brigade/scss-lint/compare/master...jlw:defect/block-disable
In my project, I added a re-enabling control comment after to pass the linter, but that shouldn't be necessary.
My uneducated guess is that this is actually a parsing error rather than a bug in the control comment logic, but I'm not familiar enough with the scss-lint
internals to go further at this time.
FYI, the test scenario failures I added are:
$ bundle exec rspec spec/scss_lint/linter_spec.rb
..........FF..FF.......................
Failures:
1) SCSSLint::Linter control comments when a linter is disabled within a rule using a CSS function split over multiple lines should not report a lint on line 12
Failure/Error: it { should_not report_lint line: 12 }
expected that a lint would not be reported
# ./spec/scss_lint/linter_spec.rb:150:in `block (5 levels) in <top (required)>'
2) SCSSLint::Linter control comments when a linter is disabled within a rule using a CSS function split over multiple lines should not report a lint on line 13
Failure/Error: it { should_not report_lint line: 13 }
expected that a lint would not be reported
# ./spec/scss_lint/linter_spec.rb:151:in `block (5 levels) in <top (required)>'
3) SCSSLint::Linter control comments when a linter is disabled within a rule using a CSS function split over multiple lines and has no child rules should not report a lint on line 5
Failure/Error: it { should_not report_lint line: 5 }
expected that a lint would not be reported
# ./spec/scss_lint/linter_spec.rb:175:in `block (6 levels) in <top (required)>'
4) SCSSLint::Linter control comments when a linter is disabled within a rule using a CSS function split over multiple lines and has no child rules should not report a lint on line 6
Failure/Error: it { should_not report_lint line: 6 }
expected that a lint would not be reported
# ./spec/scss_lint/linter_spec.rb:176:in `block (6 levels) in <top (required)>'
Finished in 0.08818 seconds (files took 0.28817 seconds to load)
39 examples, 4 failures