1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

rubocop: fix offences of the Style/YodaCondition cop

This commit is contained in:
Kyrylo Silin 2019-03-02 17:04:11 +02:00
parent cf9346f5d3
commit aab176f818
2 changed files with 2 additions and 10 deletions

View file

@ -314,14 +314,6 @@ Style/PerlBackrefs:
- 'lib/pry/method.rb'
- 'lib/pry/rubygem.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only
Style/YodaCondition:
Exclude:
- 'lib/pry/helpers/table.rb'
# Offense count: 6
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:

View file

@ -23,7 +23,7 @@ class Pry
def self.tablify(things, line_length, config = Pry.config)
table = Table.new(things, { column_count: things.size }, config)
table.column_count -= 1 until (1 == table.column_count) || table.fits_on_line?(line_length)
table.column_count -= 1 until (table.column_count == 1) || table.fits_on_line?(line_length)
table
end
@ -47,7 +47,7 @@ class Pry
next unless e
item = e.ljust(widths[i])
item.sub! e, _recall_color_for(e) if :color_on == style
item.sub! e, _recall_color_for(e) if style == :color_on
padded << item
end
padded.join(@config.ls.separator)