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:
parent
cf9346f5d3
commit
aab176f818
2 changed files with 2 additions and 10 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue