Skip to content

Commit

Permalink
Enable DotPosition cop
Browse files Browse the repository at this point in the history
since Ruby 1.8.7 is no longer supported there is no need to disable this

Change-Id: I5a3382ce1f38423d5ffd34d71345b86e7de3f27e
Reviewed-on: http://gerrit.causes.com/37454
Tested-by: jenkins <[email protected]>
Reviewed-by: Shane da Silva <[email protected]>
  • Loading branch information
geniou authored and Shane da Silva committed Apr 22, 2014
1 parent 4880aa8 commit 0d5aa79
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
6 changes: 0 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ Documentation:
- 'spec/scss_lint/*'
- 'spec/scss_lint/linter/*'

# Ruby 1.8.7 only supports trailing dots in method chains, but Rubocop still
# reports it as an error for method calls chained onto do...end blocks. That's
# too much noise, so remove it.
DotPosition:
Enabled: false

Eval:
Exclude:
- 'lib/scss_lint/sass/script.rb'
Expand Down
8 changes: 4 additions & 4 deletions lib/scss_lint/selector_visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def visit_members(sequence)
def selector_node_name(node)
# Converts the class name of a node into snake_case form, e.g.
# `Sass::Selector::SimpleSequence` -> `simple_sequence`
node.class.name.gsub(/.*::(.*?)$/, '\\1').
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
gsub(/([a-z\d])([A-Z])/, '\1_\2').
downcase
node.class.name.gsub(/.*::(.*?)$/, '\\1')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.downcase
end
end
end
6 changes: 3 additions & 3 deletions lib/scss_lint/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ module Utils
# This is useful for lints that wish to ignore interpolation, since
# interpolation can't be resolved at this step.
def extract_string_selectors(selector_array)
selector_array.reject { |item| item.is_a? Sass::Script::Node }.
join.
split
selector_array.reject { |item| item.is_a? Sass::Script::Node }
.join
.split
end

def shortest_hex_form(hex)
Expand Down
4 changes: 2 additions & 2 deletions spec/scss_lint/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def safe_run
end

it 'uses the default reporter' do
SCSSLint::Reporter::DefaultReporter.any_instance.
should_receive(:report_lints)
SCSSLint::Reporter::DefaultReporter.any_instance
.should_receive(:report_lints)
safe_run
end
end
Expand Down
20 changes: 10 additions & 10 deletions spec/scss_lint/reporter/xml_reporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
end

it 'contains a <file> node for each file' do
xml.xpath('//file').map { |node| node[:name] }.
should =~ filenames.uniq
xml.xpath('//file').map { |node| node[:name] }
.should =~ filenames.uniq
end

it 'contains <issue> nodes grouped by <file>' do
Expand All @@ -65,23 +65,23 @@
end

it 'marks each issue with a line number' do
xml.xpath('//issue[@line]').map { |node| node[:line] }.
should =~ locations.map { |location| location.line.to_s }
xml.xpath('//issue[@line]').map { |node| node[:line] }
.should =~ locations.map { |location| location.line.to_s }
end

it 'marks each issue with a column number' do
xml.xpath('//issue[@column]').map { |node| node[:column] }.
should =~ locations.map { |location| location.column.to_s }
xml.xpath('//issue[@column]').map { |node| node[:column] }
.should =~ locations.map { |location| location.column.to_s }
end

it 'marks each issue with a length' do
xml.xpath('//issue[@length]').map { |node| node[:length] }.
should =~ locations.map { |location| location.length.to_s }
xml.xpath('//issue[@length]').map { |node| node[:length] }
.should =~ locations.map { |location| location.length.to_s }
end

it 'marks each issue with a reason containing the lint description' do
xml.xpath('//issue[@reason]').map { |node| node[:reason] }.
should =~ descriptions
xml.xpath('//issue[@reason]').map { |node| node[:reason] }
.should =~ descriptions
end

context 'when lints are warnings' do
Expand Down

0 comments on commit 0d5aa79

Please sign in to comment.