scss_lint-auto_correct 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f02b59e2ba450a6240d4cc537f6829deb900e39d
4
- data.tar.gz: 31f982e70b5573bf1109bd540d2c41f0245625c7
3
+ metadata.gz: ba31ad11e01bc97606f3bf7ea0a8f01d4495aa74
4
+ data.tar.gz: 7d4724e51e377269ae3327ddd0c12af40c1d1a69
5
5
  SHA512:
6
- metadata.gz: 6de3ebef2afc22be17b0bdbc59d0ad3f0cc32bd973192d30813a559e0b38c844c130f6b661349e684c24bba7925739b413145881e1eafd6b52615369e912eaba
7
- data.tar.gz: c1fa01797cb26f47f7efbbf77509a1489c9f092b99460eb0ee58d44ea1425f52da31898d31d08d9b161443193c6414b46110c237ba683017a83b8c54b4efacf6
6
+ metadata.gz: 5795bece705bd92b234a86cb8547bb3d8a64c6ff26af39c5f5e86c4182f0f882bf9454bd1d21cbbeca377108fe0d12b880e4dd30c41afa866a25b116e3bde657
7
+ data.tar.gz: a0a7be4773f3b483fa665c0b1ee481e295d3c49e1e0c933c506bcbd515c04b95df09dc09535940daa64e2ef1b54973b1a5abcf37185b2fdd19ec593744948501
@@ -36,6 +36,10 @@ module SCSSLint::AutoCorrect
36
36
 
37
37
  def run(argv)
38
38
  parse_args! argv
39
+ if option? :version
40
+ puts VERSION
41
+ return 0
42
+ end
39
43
  load_config!
40
44
  if option? :help, :h
41
45
  print_help
@@ -116,7 +120,7 @@ module SCSSLint::AutoCorrect
116
120
  def selected_correctors
117
121
  selected = []
118
122
  unselected = []
119
- selected_correctors.each do |c|
123
+ @correctors.each do |c|
120
124
  selected << c if option? c.short_name
121
125
  unselected << c if option? "no-#{c.short_name}"
122
126
  end
@@ -5,7 +5,7 @@ module SCSSLint::AutoCorrect::Correctors
5
5
  linter = SCSSLint::Linter::StringQuotes.new
6
6
  contents.gsub(/"[^"]*"|'[^']*'/) do |mm|
7
7
  unescaped = linter.__send__ :extract_string_without_quotes, mm
8
- unescaped.dump
8
+ '"' + unescaped + '"'
9
9
  end
10
10
  end
11
11
 
@@ -35,6 +35,9 @@ module SCSSLint::AutoCorrect
35
35
  def parse_line(line)
36
36
  mm = line.match(/^\s*([^:]+):/)
37
37
  full = mm[1]
38
+ ['$', '@', '('].each do |char|
39
+ return nil if full.include? char
40
+ end
38
41
  if full[0] == "-"
39
42
  mm2 = full.match(/^-([^-]+)-(.*)$/)
40
43
  {
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module SCSSLint::AutoCorrect
3
- VERSION = '1.2.2'.freeze
3
+ VERSION = '1.2.3'.freeze
4
4
  end
@@ -0,0 +1,4 @@
1
+ $foo-font-family-sans-serif: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
2
+ $foo-font-family-serif: "Book Antiqua", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
3
+ $foo-background-color: #f9f9f9;
4
+ $foo-label-color: #767676;
@@ -20,5 +20,12 @@ class PropertySortOrderTest < Minitest::Test
20
20
  output = corrector.new.call input
21
21
  assert_equal input, output
22
22
  end
23
+
24
+ it "doesnt try to sort variable declarations" do
25
+ input = load_file "variable_declarations.scss"
26
+ expected = input
27
+ output = corrector.new.call input
28
+ assert_equal expected, output
29
+ end
23
30
  end
24
31
  end
@@ -20,5 +20,11 @@ class StringQuotesTest < Minitest::Test
20
20
  output = corrector.new.call(input)
21
21
  assert_equal input, output
22
22
  end
23
+
24
+ it "respectfully deals with backslashes" do
25
+ input = ".lorem { content: \"\\f078\\\\foo\" }"
26
+ output = corrector.new.call(input)
27
+ assert_equal input, output
28
+ end
23
29
  end
24
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scss_lint-auto_correct
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
@@ -80,6 +80,7 @@ files:
80
80
  - test/fixtures/unsorted_properties.scss
81
81
  - test/fixtures/unsorted_properties_corrected.scss
82
82
  - test/fixtures/unsorted_properties_disable_rule.scss
83
+ - test/fixtures/variable_declarations.scss
83
84
  - test/test_helper.rb
84
85
  - test/unit/cli_test.rb
85
86
  - test/unit/color_keyword.rb
@@ -144,6 +145,7 @@ test_files:
144
145
  - test/fixtures/unsorted_properties.scss
145
146
  - test/fixtures/unsorted_properties_corrected.scss
146
147
  - test/fixtures/unsorted_properties_disable_rule.scss
148
+ - test/fixtures/variable_declarations.scss
147
149
  - test/test_helper.rb
148
150
  - test/unit/cli_test.rb
149
151
  - test/unit/color_keyword.rb