Skip to content

Commit

Permalink
Change the max line length of Layout/LineLength to 120
Browse files Browse the repository at this point in the history
  • Loading branch information
richardstewart0213 committed May 12, 2020
1 parent 77455fe commit 617a1c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions lib/rubocop/cop/performance/redundant_merge.rb
Expand Up @@ -182,9 +182,7 @@ def second_argument
end

def unwind(receiver)
while receiver.respond_to?(:send_type?) && receiver.send_type?
receiver, = *receiver
end
receiver, = *receiver while receiver.respond_to?(:send_type?) && receiver.send_type?
receiver
end

Expand Down
12 changes: 3 additions & 9 deletions lib/rubocop/cop/performance/string_replacement.rb
Expand Up @@ -48,9 +48,7 @@ def autocorrect(node)
first_source, = first_source(first_param)
second_source, = *second_param

unless first_param.str_type?
first_source = interpret_string_escapes(first_source)
end
first_source = interpret_string_escapes(first_source) unless first_param.str_type?

replacement_method =
replacement_method(node, first_source, second_source)
Expand All @@ -67,9 +65,7 @@ def replace_method(node, first, second, first_param, replacement)
to_string_literal(first))
end

if second.empty? && first.length == 1
remove_second_param(corrector, node, first_param)
end
remove_second_param(corrector, node, first_param) if second.empty? && first.length == 1
end
end

Expand Down Expand Up @@ -99,9 +95,7 @@ def accept_first_param?(first_param)

def offense(node, first_param, second_param)
first_source, = first_source(first_param)
unless first_param.str_type?
first_source = interpret_string_escapes(first_source)
end
first_source = interpret_string_escapes(first_source) unless first_param.str_type?
second_source, = *second_param
message = message(node, first_source, second_source)

Expand Down
2 changes: 1 addition & 1 deletion spec/project_spec.rb
Expand Up @@ -140,7 +140,7 @@
it 'has a valid URL' do
issues.each do |issue|
number = issue[:number].gsub(/\D/, '')
pattern = %r{^https://github\.com/rubocop-hq/rubocop-performance/(?:issues|pull)/#{number}$} # rubocop:disable Layout/LineLength
pattern = %r{^https://github\.com/rubocop-hq/rubocop-performance/(?:issues|pull)/#{number}$}
expect(issue[:url]).to match(pattern)
end
end
Expand Down

0 comments on commit 617a1c3

Please sign in to comment.