scss-lint 0.23.0 → 0.23.1

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: 1bbc506b11e888967c3a60b4ee497049899db21d
4
- data.tar.gz: 3474861bb7c69bc96acfc51a6c4c78ac75372bb3
3
+ metadata.gz: 2d1a01eec7c1dd954e81749c6a668a660013b228
4
+ data.tar.gz: 05988d04580327776387a94171c4297f6a7493d1
5
5
  SHA512:
6
- metadata.gz: abdcc9357f0db63b291114acf5748ea2df1ca077fca03033b8b71ac4faae48d26424d00ea23c846854f9da47a6c67baf5187cb34932182ced1f987932cc58970
7
- data.tar.gz: 673461370cc8c5598b25bea6b2a06e8e61cb3b53389a7a729cebf6eb79b836b36d4e4c3d211a5aebf6826423b0536f27575042b1ee450712acc5f837b0031941
6
+ metadata.gz: f82ac7a86ac50b2f172f0bb08879ec3fef8fc20f6fbdbf35816ea6cab6feae0963062da65ae550a86bf7106d3e44e755c3d510baf81a2ed43f779b3248d0ba2e
7
+ data.tar.gz: a47bd582bb1208992367eb5f7f3f61fde36a9d308f8be3745532333a08c70d0e04f90a14adb00e71e409ee3ea6547b46bb1d9d27909e345fe332f3082fe67474
@@ -45,7 +45,7 @@ module SCSSLint
45
45
  end
46
46
 
47
47
  # @return [OptionParser]
48
- def options_parser
48
+ def options_parser # rubocop:disable MethodLength
49
49
  @options_parser ||= OptionParser.new do |opts|
50
50
  opts.banner = "Usage: #{opts.program_name} [options] [scss-files]"
51
51
 
@@ -62,7 +62,7 @@ module SCSSLint
62
62
  end
63
63
 
64
64
  opts.on('-f', '--format Formatter', 'Specify how to display lints', String) do |format|
65
- set_output_format(format)
65
+ define_output_format(format)
66
66
  end
67
67
 
68
68
  opts.on('-i', '--include-linter linter,...', Array,
@@ -189,7 +189,7 @@ module SCSSLint
189
189
  end
190
190
 
191
191
  # @param format [String]
192
- def set_output_format(format)
192
+ def define_output_format(format)
193
193
  @options[:reporter] = SCSSLint::Reporter.const_get(format + 'Reporter')
194
194
  rescue NameError
195
195
  puts "Invalid output format specified: #{format}"
@@ -44,7 +44,7 @@ module SCSSLint
44
44
  length = if range.start_pos.line == range.end_pos.line
45
45
  range.end_pos.offset - range.start_pos.offset
46
46
  else
47
- line_source = engine.lines[range.start_pos.line]
47
+ line_source = engine.lines[range.start_pos.line - 1]
48
48
  line_source.length - range.start_pos.offset + 1
49
49
  end
50
50
 
@@ -23,6 +23,7 @@ module SCSSLint
23
23
 
24
24
  # Define stubs so we don't check rules nested in other constructs
25
25
  %w[
26
+ directive
26
27
  media
27
28
  mixin
28
29
  mixindef
@@ -15,7 +15,7 @@ module SCSSLint
15
15
  if can_be_simplified
16
16
  # TODO: Sass::Selector::SimpleSequence#source_range sometimes lies about
17
17
  # its line, so reference `#line` directly
18
- add_lint(seq.line, "Selector `#{seq}` can be simplified to `#{id_sel}`, " <<
18
+ add_lint(seq.line, "Selector `#{seq}` can be simplified to `#{id_sel}`, " \
19
19
  'since IDs should be uniquely identifying')
20
20
  end
21
21
  end
@@ -21,8 +21,7 @@ module SCSSLint
21
21
  # Sass::Script::Nodes, we need to condense it into a single string that we
22
22
  # can run a regex against.
23
23
  def condense_to_string(sequence_list)
24
- sequence_list.select { |item| item.is_a?(String) }
25
- .inject('') { |combined, item| combined + item }
24
+ sequence_list.select { |item| item.is_a?(String) }.inject(:+)
26
25
  end
27
26
 
28
27
  # Removes extra spacing between lines in a comma-separated sequence due to
@@ -27,8 +27,8 @@ module SCSSLint
27
27
 
28
28
  if spaces != @spaces
29
29
  location = Location.new(index + 1)
30
- message = "Expected #{pluralize(@spaces, 'space')}" <<
31
- " between parentheses instead of #{spaces}"
30
+ message = "Expected #{pluralize(@spaces, 'space')} " \
31
+ "between parentheses instead of #{spaces}"
32
32
  @lints << Lint.new(engine.filename, location, message)
33
33
  end
34
34
  end
@@ -6,14 +6,14 @@ module SCSSLint
6
6
 
7
7
  output << '<lint>'
8
8
  lints.group_by(&:filename).each do |filename, file_lints|
9
- output << "<file name=#{filename.encode(:xml => :attr)}>"
9
+ output << "<file name=#{filename.encode(xml: :attr)}>"
10
10
 
11
11
  file_lints.each do |lint|
12
12
  output << "<issue line=\"#{lint.location.line}\" " <<
13
13
  "column=\"#{lint.location.column}\" " <<
14
14
  "length=\"#{lint.location.length}\" " <<
15
15
  "severity=\"#{lint.severity}\" " <<
16
- "reason=#{lint.description.encode(:xml => :attr)} />"
16
+ "reason=#{lint.description.encode(xml: :attr)} />"
17
17
  end
18
18
 
19
19
  output << '</file>'
@@ -67,7 +67,7 @@ module Sass::Tree
67
67
  def children
68
68
  begin
69
69
  additional_children = extract_script_nodes(value)
70
- rescue NotImplementedError
70
+ rescue NotImplementedError # rubocop:disable HandleExceptions
71
71
  # Directive nodes may not define `value`
72
72
  end
73
73
  concat_expr_lists super, additional_children
@@ -23,10 +23,10 @@ module SCSSLint
23
23
  def selector_node_name(node)
24
24
  # Converts the class name of a node into snake_case form, e.g.
25
25
  # `Sass::Selector::SimpleSequence` -> `simple_sequence`
26
- node.class.name.gsub(/.*::(.*?)$/, '\\1').
27
- gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
28
- gsub(/([a-z\d])([A-Z])/, '\1_\2').
29
- downcase
26
+ node.class.name.gsub(/.*::(.*?)$/, '\\1')
27
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
28
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
29
+ .downcase
30
30
  end
31
31
  end
32
32
  end
@@ -15,9 +15,9 @@ module SCSSLint
15
15
  # This is useful for lints that wish to ignore interpolation, since
16
16
  # interpolation can't be resolved at this step.
17
17
  def extract_string_selectors(selector_array)
18
- selector_array.reject { |item| item.is_a? Sass::Script::Node }.
19
- join.
20
- split
18
+ selector_array.reject { |item| item.is_a? Sass::Script::Node }
19
+ .join
20
+ .split
21
21
  end
22
22
 
23
23
  def shortest_hex_form(hex)
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module SCSSLint
3
- VERSION = '0.23.0'
3
+ VERSION = '0.23.1'
4
4
  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.23.0
4
+ version: 0.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Causes Engineering
@@ -67,6 +67,20 @@ dependencies:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '2.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rubocop
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
70
84
  description: Configurable tool for writing clean and consistent SCSS
71
85
  email:
72
86
  - eng@causes.com