scss_lint 0.40.0 → 0.40.1
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/lib/scss_lint/config.rb +16 -12
- data/lib/scss_lint/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d64ee14edbfefaee47bcf0b30500c2ee83231c0
|
4
|
+
data.tar.gz: 513d15bc52ea0f5d854972d661053c6ccc79f855
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60cff3d31434509cb38dcee086f0f877f4346f5c9cb060d26897193e02b21e5c5109fe68dbc53f3bd99c4ca31ec09746a698ae5b8eed9ede9f57dd1dbf494777
|
7
|
+
data.tar.gz: 386501b6cb355a6924e1e2f6c0741a68dd54a7245fd28f7b71dac6488c32e79322d435bb1f5d69a419b680bdc30aefca0bfe604b104f697054e5ae6cc81a98ec
|
data/lib/scss_lint/config.rb
CHANGED
@@ -208,7 +208,18 @@ module SCSSLint
|
|
208
208
|
end
|
209
209
|
|
210
210
|
def load_plugins
|
211
|
-
|
211
|
+
previous_linters = LinterRegistry.linters
|
212
|
+
plugins = SCSSLint::Plugins.new(self).load
|
213
|
+
new_linters = LinterRegistry.linters - previous_linters
|
214
|
+
|
215
|
+
plugins.each do |plugin|
|
216
|
+
# Have the plugin options be overrideable by the local configuration
|
217
|
+
@options = self.class.send(:smart_merge, plugin.config.options, @options)
|
218
|
+
end
|
219
|
+
|
220
|
+
# We only want to set defaults for linters introduced via plugins,
|
221
|
+
# otherwise we'll accidentally enable some linters
|
222
|
+
ensure_linters_have_default_options(new_linters)
|
212
223
|
end
|
213
224
|
|
214
225
|
def enabled_linters
|
@@ -218,7 +229,7 @@ module SCSSLint
|
|
218
229
|
end
|
219
230
|
|
220
231
|
def linter_enabled?(linter)
|
221
|
-
linter_options(linter)
|
232
|
+
(linter_options(linter) || {}).fetch('enabled', false)
|
222
233
|
end
|
223
234
|
|
224
235
|
def enable_linter(linter)
|
@@ -236,7 +247,7 @@ module SCSSLint
|
|
236
247
|
end
|
237
248
|
|
238
249
|
def linter_options(linter)
|
239
|
-
@options['linters']
|
250
|
+
@options['linters'].fetch(self.class.linter_name(linter), {})
|
240
251
|
end
|
241
252
|
|
242
253
|
def excluded_file?(file_path)
|
@@ -289,15 +300,8 @@ module SCSSLint
|
|
289
300
|
end
|
290
301
|
end
|
291
302
|
|
292
|
-
def
|
293
|
-
|
294
|
-
# Have the plugin options be overrideable by the local configuration
|
295
|
-
@options = self.class.send(:smart_merge, plugin.config.options, @options)
|
296
|
-
end
|
297
|
-
end
|
298
|
-
|
299
|
-
def ensure_plugins_have_default_options
|
300
|
-
LinterRegistry.linters.each do |linter|
|
303
|
+
def ensure_linters_have_default_options(linters)
|
304
|
+
linters.each do |linter|
|
301
305
|
if linter_options(linter).nil?
|
302
306
|
@options['linters'].merge!(default_plugin_options(linter))
|
303
307
|
end
|
data/lib/scss_lint/version.rb
CHANGED