scss_lint 0.53.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28bb5edd241b1790563ffb57972f89f8a169f9af
4
- data.tar.gz: c1a9b234a92f4729a7ec3353fd7e7c7d03fff662
3
+ metadata.gz: aff9c12976312f5790dca3b5423ae1413cfbd1ec
4
+ data.tar.gz: 138c24adcf244fa81f594e3c2a1b82003da97782
5
5
  SHA512:
6
- metadata.gz: d29131bc10b67067ad84e4ebc5aac6a8857a017ae963b26e54804338d50bad871756c373e7588929e1c0e5a43334b89d09f44788ace9ad9a79ef3586d4ac4229
7
- data.tar.gz: e0aa4f037e09dde3fa7487dcab53802d8cd3f481ac083b19f201500d059d2cdf90c1c4d2e92d33c5f075b56849bf93f9913ed0191ade5d8e8135dd804e611954
6
+ metadata.gz: 5f9f93bcf637bd292942415c4570a75ccecc595819e1a5890e8846c38e9f23a16cfa4a93cb73a292b8e87f824a86fb95b6334f868cc05a80b2b610e3096a86dd
7
+ data.tar.gz: 6a65980f9c12a3c7bdd0b085f189fcb6b0fbc7e5063acca043de4960154e825d4ebe7bcdb44837903b4571a907f108864b3dc1065d244e2031da96991e8eed02
@@ -208,13 +208,22 @@ grid-auto-flow
208
208
  grid-auto-rows
209
209
  grid-before
210
210
  grid-column
211
+ grid-column-end
212
+ grid-column-gap
213
+ grid-column-start
211
214
  grid-columns
212
215
  grid-end
216
+ grid-gap
213
217
  grid-row
218
+ grid-row-end
219
+ grid-row-gap
220
+ grid-row-start
214
221
  grid-rows
215
222
  grid-start
216
223
  grid-template
217
224
  grid-template-areas
225
+ grid-template-columns
226
+ grid-template-rows
218
227
  hanging-punctuation
219
228
  height
220
229
  highlight
@@ -75,6 +75,10 @@ module SCSSLint
75
75
  line_source.length - range.start_pos.offset + 1
76
76
  end
77
77
 
78
+ # Workaround for https://github.com/brigade/scss-lint/issues/887 to acount for
79
+ # https://github.com/sass/sass/issues/2284.
80
+ length = 1 if length < 1
81
+
78
82
  Location.new(range.start_pos.line, range.start_pos.offset, length)
79
83
  end
80
84
 
@@ -97,8 +97,8 @@ module SCSSLint
97
97
  end
98
98
 
99
99
  def visit_import(node)
100
- prev = previous_node(node)
101
- return if prev.is_a?(Sass::Tree::ImportNode) && source_from_range(prev.source_range) =~ /,$/
100
+ previous_node(node)
101
+ return unless engine.lines[node.line - 1] =~ /@import/
102
102
  check_indentation(node)
103
103
  end
104
104
 
@@ -10,6 +10,8 @@ module SCSSLint
10
10
  translateX translateY translateZ
11
11
  linear-gradient repeating-linear-gradient
12
12
  radial-gradient repeating-radial-gradient
13
+ cubic-bezier
14
+ fit-content
13
15
  ].to_set.freeze
14
16
 
15
17
  SCSS_FUNCTION_WHITELIST = %w[
@@ -58,6 +58,9 @@ module SCSSLint
58
58
  def whitespace_after_comment(source, offset)
59
59
  whitespace = 0
60
60
 
61
+ # Allow for comments that start with `/// `.
62
+ offset += 1 if source[offset] == '/'
63
+
61
64
  while [' ', "\t"].include? source[offset]
62
65
  whitespace += 1
63
66
  offset += 1
@@ -47,7 +47,7 @@ module SCSSLint
47
47
  end
48
48
 
49
49
  def check_for_one_space_or_newline(node, whitespace)
50
- return if whitespace == [' '] || whitespace == ["\n"]
50
+ return if [[' '], ["\n"]].include?(whitespace)
51
51
  return if whitespace[0] == "\n" && whitespace[1..-1].uniq == [' ']
52
52
  add_lint(node, 'Colon after property should be followed by one space or a newline')
53
53
  end
@@ -37,7 +37,7 @@ module SCSSLint
37
37
  end
38
38
 
39
39
  def check_for_one_space_or_newline(node, whitespace)
40
- return if whitespace == [' '] || whitespace == ["\n"]
40
+ return if [[' '], ["\n"]].include?(whitespace)
41
41
  return if whitespace[0] == "\n" && whitespace[1..-1].uniq == [' ']
42
42
  add_lint(node, 'Colon after variable should be followed by one space or a newline')
43
43
  end
@@ -51,7 +51,7 @@ module SCSSLint
51
51
  offset = offset_to(start_pos, ':', offset) + 1
52
52
 
53
53
  # Count spaces after the colon
54
- while [' ', "\t", "\n"].include? character_at(start_pos, offset)
54
+ while [' ', "\t", "\n"].include?(character_at(start_pos, offset))
55
55
  whitespace << character_at(start_pos, offset)
56
56
  offset += 1
57
57
  end
@@ -12,7 +12,7 @@ module SCSSLint
12
12
  require @name
13
13
  @config = plugin_config
14
14
  self
15
- rescue Gem::LoadError, LoadError
15
+ rescue LoadError
16
16
  raise SCSSLint::Exceptions::PluginGemLoadError,
17
17
  "Unable to load linter plugin gem '#{@name}'. Try running " \
18
18
  "`gem install #{@name}`, or adding it to your Gemfile and " \
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module SCSSLint
5
- VERSION = '0.53.0'.freeze
5
+ VERSION = '0.54.0'.freeze
6
6
  end
@@ -238,6 +238,16 @@ describe SCSSLint::Linter::Indentation do
238
238
  it { should_not report_lint }
239
239
  end
240
240
 
241
+ context 'when an @import spans multiple lines and leads with a newline' do
242
+ let(:scss) { <<-SCSS }
243
+ @import
244
+ 'foo',
245
+ 'bar';
246
+ SCSS
247
+
248
+ it { should_not report_lint }
249
+ end
250
+
241
251
  context 'when tabs are preferred' do
242
252
  let(:linter_config) { { 'character' => 'tab', 'width' => 1 } }
243
253
 
@@ -38,6 +38,14 @@ describe SCSSLint::Linter::SpaceAfterComment do
38
38
  it { should report_lint line: 1 }
39
39
  end
40
40
 
41
+ context 'when silent three-slash comment' do
42
+ let(:scss) { <<-SCSS }
43
+ /// triple slash
44
+ SCSS
45
+
46
+ it { should_not report_lint }
47
+ end
48
+
41
49
  context 'when inline silent comment and no space' do
42
50
  let(:scss) { <<-SCSS }
43
51
  p {
@@ -112,11 +112,11 @@ 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[:path] }
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
119
- expect { subject }.to raise_error { |e| e.backtrace.should == backtrace }
119
+ expect { subject }.to(raise_error { |e| e.backtrace.should == backtrace })
120
120
  end
121
121
  end
122
122
  end
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.53.0
4
+ version: 0.54.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: 2017-04-10 00:00:00.000000000 Z
12
+ date: 2017-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  version: '0'
273
273
  requirements: []
274
274
  rubyforge_project:
275
- rubygems_version: 2.4.5.1
275
+ rubygems_version: 2.6.11
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: SCSS lint tool