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 +4 -4
- data/data/properties.txt +9 -0
- data/lib/scss_lint/linter.rb +4 -0
- data/lib/scss_lint/linter/indentation.rb +2 -2
- data/lib/scss_lint/linter/name_format.rb +2 -0
- data/lib/scss_lint/linter/space_after_comment.rb +3 -0
- data/lib/scss_lint/linter/space_after_property_colon.rb +1 -1
- data/lib/scss_lint/linter/space_after_variable_colon.rb +2 -2
- data/lib/scss_lint/plugins/linter_gem.rb +1 -1
- data/lib/scss_lint/version.rb +1 -1
- data/spec/scss_lint/linter/indentation_spec.rb +10 -0
- data/spec/scss_lint/linter/space_after_comment_spec.rb +8 -0
- data/spec/scss_lint/runner_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aff9c12976312f5790dca3b5423ae1413cfbd1ec
|
4
|
+
data.tar.gz: 138c24adcf244fa81f594e3c2a1b82003da97782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9f93bcf637bd292942415c4570a75ccecc595819e1a5890e8846c38e9f23a16cfa4a93cb73a292b8e87f824a86fb95b6334f868cc05a80b2b610e3096a86dd
|
7
|
+
data.tar.gz: 6a65980f9c12a3c7bdd0b085f189fcb6b0fbc7e5063acca043de4960154e825d4ebe7bcdb44837903b4571a907f108864b3dc1065d244e2031da96991e8eed02
|
data/data/properties.txt
CHANGED
@@ -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
|
data/lib/scss_lint/linter.rb
CHANGED
@@ -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
|
-
|
101
|
-
return
|
100
|
+
previous_node(node)
|
101
|
+
return unless engine.lines[node.line - 1] =~ /@import/
|
102
102
|
check_indentation(node)
|
103
103
|
end
|
104
104
|
|
@@ -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
|
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
|
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?
|
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
|
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 " \
|
data/lib/scss_lint/version.rb
CHANGED
@@ -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
|
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
|
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.
|
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-
|
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.
|
275
|
+
rubygems_version: 2.6.11
|
276
276
|
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: SCSS lint tool
|