scss_lint 0.42.2 → 0.43.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/config/default.yml +9 -1
  3. data/data/properties.txt +1 -1
  4. data/lib/scss_lint/cli.rb +11 -5
  5. data/lib/scss_lint/config.rb +1 -2
  6. data/lib/scss_lint/control_comment_processor.rb +33 -28
  7. data/lib/scss_lint/engine.rb +10 -7
  8. data/lib/scss_lint/linter.rb +56 -12
  9. data/lib/scss_lint/linter/chained_classes.rb +21 -0
  10. data/lib/scss_lint/linter/color_variable.rb +0 -7
  11. data/lib/scss_lint/linter/comment.rb +15 -1
  12. data/lib/scss_lint/linter/empty_line_between_blocks.rb +10 -0
  13. data/lib/scss_lint/linter/indentation.rb +47 -53
  14. data/lib/scss_lint/linter/mergeable_selector.rb +29 -0
  15. data/lib/scss_lint/linter/property_spelling.rb +18 -6
  16. data/lib/scss_lint/linter/pseudo_element.rb +18 -0
  17. data/lib/scss_lint/linter/single_line_per_selector.rb +23 -7
  18. data/lib/scss_lint/linter/space_after_property_colon.rb +5 -6
  19. data/lib/scss_lint/linter/space_after_property_name.rb +1 -7
  20. data/lib/scss_lint/linter/space_after_variable_name.rb +1 -1
  21. data/lib/scss_lint/linter/space_around_operator.rb +23 -7
  22. data/lib/scss_lint/linter/string_quotes.rb +2 -9
  23. data/lib/scss_lint/linter/trailing_semicolon.rb +10 -0
  24. data/lib/scss_lint/options.rb +5 -0
  25. data/lib/scss_lint/runner.rb +10 -8
  26. data/lib/scss_lint/selector_visitor.rb +11 -3
  27. data/lib/scss_lint/version.rb +1 -1
  28. data/spec/scss_lint/cli_spec.rb +14 -0
  29. data/spec/scss_lint/linter/chained_classes_spec.rb +45 -0
  30. data/spec/scss_lint/linter/comment_spec.rb +16 -0
  31. data/spec/scss_lint/linter/empty_line_between_blocks_spec.rb +62 -0
  32. data/spec/scss_lint/linter/indentation_spec.rb +1 -9
  33. data/spec/scss_lint/linter/leading_zero_spec.rb +12 -0
  34. data/spec/scss_lint/linter/mergeable_selector_spec.rb +59 -0
  35. data/spec/scss_lint/linter/property_spelling_spec.rb +28 -0
  36. data/spec/scss_lint/linter/pseudo_element_spec.rb +71 -0
  37. data/spec/scss_lint/linter/single_line_per_selector_spec.rb +28 -1
  38. data/spec/scss_lint/linter/space_after_variable_name_spec.rb +12 -0
  39. data/spec/scss_lint/linter/space_around_operator_spec.rb +51 -0
  40. data/spec/scss_lint/linter/trailing_semicolon_spec.rb +28 -0
  41. data/spec/scss_lint/linter_spec.rb +17 -0
  42. data/spec/scss_lint/runner_spec.rb +2 -2
  43. metadata +9 -3
@@ -249,6 +249,23 @@ describe SCSSLint::Linter do
249
249
  it { should_not report_lint }
250
250
  end
251
251
 
252
+ context 'when there are multiple consecutive command comments' do
253
+ let(:scss) { <<-SCSS }
254
+ // scss-lint:disable Fake
255
+ // scss-lint:disable Fake2
256
+ p {
257
+ border: fail1;
258
+ }
259
+ SCSS
260
+
261
+ it { should_not report_lint }
262
+
263
+ it 'disabled both linters' do
264
+ class SCSSLint::Linter::Fake2 < SCSSLint::Linter::Fake; end
265
+ SCSSLint::Linter::Fake2.new.should_not report_lint
266
+ end
267
+ end
268
+
252
269
  context 'when the command comment is below an attached comment and a lint' do
253
270
  let(:scss) { <<-SCSS }
254
271
  // 1. Some comment about my background
@@ -23,7 +23,7 @@ describe SCSSLint::Runner do
23
23
  class SCSSLint::Linter::FakeLinter2 < SCSSLint::Linter; end
24
24
 
25
25
  describe '#run' do
26
- let(:files) { ['dummy1.scss', 'dummy2.scss'] }
26
+ let(:files) { [{ path: 'dummy1.scss' }, { path: 'dummy2.scss' }] }
27
27
  subject { runner.run(files) }
28
28
 
29
29
  before do
@@ -112,7 +112,7 @@ describe SCSSLint::Runner do
112
112
  end
113
113
 
114
114
  it 'has the name of the file the linter was checking' do
115
- expect { subject }.to raise_error { |e| e.message.should include files.first }
115
+ expect { subject }.to raise_error { |e| e.message.should include files.first[:path] }
116
116
  end
117
117
 
118
118
  it 'has the same backtrace as the original error' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scss_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.2
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brigade Engineering
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-02 00:00:00.000000000 Z
12
+ date: 2015-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
@@ -84,6 +84,7 @@ files:
84
84
  - lib/scss_lint/linter/bang_format.rb
85
85
  - lib/scss_lint/linter/bem_depth.rb
86
86
  - lib/scss_lint/linter/border_zero.rb
87
+ - lib/scss_lint/linter/chained_classes.rb
87
88
  - lib/scss_lint/linter/color_keyword.rb
88
89
  - lib/scss_lint/linter/color_variable.rb
89
90
  - lib/scss_lint/linter/comment.rb
@@ -114,6 +115,7 @@ files:
114
115
  - lib/scss_lint/linter/property_sort_order.rb
115
116
  - lib/scss_lint/linter/property_spelling.rb
116
117
  - lib/scss_lint/linter/property_units.rb
118
+ - lib/scss_lint/linter/pseudo_element.rb
117
119
  - lib/scss_lint/linter/qualifying_element.rb
118
120
  - lib/scss_lint/linter/selector_depth.rb
119
121
  - lib/scss_lint/linter/selector_format.rb
@@ -166,6 +168,7 @@ files:
166
168
  - spec/scss_lint/linter/bang_format_spec.rb
167
169
  - spec/scss_lint/linter/bem_depth_spec.rb
168
170
  - spec/scss_lint/linter/border_zero_spec.rb
171
+ - spec/scss_lint/linter/chained_classes_spec.rb
169
172
  - spec/scss_lint/linter/color_keyword_spec.rb
170
173
  - spec/scss_lint/linter/color_variable_spec.rb
171
174
  - spec/scss_lint/linter/comment_spec.rb
@@ -195,6 +198,7 @@ files:
195
198
  - spec/scss_lint/linter/property_sort_order_spec.rb
196
199
  - spec/scss_lint/linter/property_spelling_spec.rb
197
200
  - spec/scss_lint/linter/property_units_spec.rb
201
+ - spec/scss_lint/linter/pseudo_element_spec.rb
198
202
  - spec/scss_lint/linter/qualifying_element_spec.rb
199
203
  - spec/scss_lint/linter/selector_depth_spec.rb
200
204
  - spec/scss_lint/linter/selector_format_spec.rb
@@ -260,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
264
  version: '0'
261
265
  requirements: []
262
266
  rubyforge_project:
263
- rubygems_version: 2.4.8
267
+ rubygems_version: 2.4.5.1
264
268
  signing_key:
265
269
  specification_version: 4
266
270
  summary: SCSS lint tool
@@ -273,6 +277,7 @@ test_files:
273
277
  - spec/scss_lint/linter/bang_format_spec.rb
274
278
  - spec/scss_lint/linter/bem_depth_spec.rb
275
279
  - spec/scss_lint/linter/border_zero_spec.rb
280
+ - spec/scss_lint/linter/chained_classes_spec.rb
276
281
  - spec/scss_lint/linter/color_keyword_spec.rb
277
282
  - spec/scss_lint/linter/color_variable_spec.rb
278
283
  - spec/scss_lint/linter/comment_spec.rb
@@ -302,6 +307,7 @@ test_files:
302
307
  - spec/scss_lint/linter/property_sort_order_spec.rb
303
308
  - spec/scss_lint/linter/property_spelling_spec.rb
304
309
  - spec/scss_lint/linter/property_units_spec.rb
310
+ - spec/scss_lint/linter/pseudo_element_spec.rb
305
311
  - spec/scss_lint/linter/qualifying_element_spec.rb
306
312
  - spec/scss_lint/linter/selector_depth_spec.rb
307
313
  - spec/scss_lint/linter/selector_format_spec.rb