Enable Style/ZeroLengthPredicate

This commit is contained in:
gregoirenovel 2018-10-01 13:53:15 +02:00
parent 1b8e38253e
commit 1f4ef0074f
4 changed files with 4 additions and 4 deletions

View file

@ -1268,4 +1268,4 @@ Style/YodaCondition:
Enabled: false
Style/ZeroLengthPredicate:
Enabled: false
Enabled: true

View file

@ -20,7 +20,7 @@ module Carto
def convert_driver_result_to_full_address
result = JSON.parse(driver.call)
if result['features'].size == 0
if result['features'].empty?
Rails.logger.error "unable to find location for address #{@address}"
return []
end

View file

@ -19,7 +19,7 @@ module Carto
def convert_driver_result_to_point
result = JSON.parse(driver.call)
if result['features'].size == 0
if result['features'].empty?
Rails.logger.error "unable to find location for address #{@address}"
return nil
end

View file

@ -24,7 +24,7 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do
def sanitize_name(name) # from https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/sanitized_file.rb#L323
name = name.gsub(/[^[:word:]\.\-\+]/,"_")
name = "_#{name}" if name.match?(/\A\.+\z/)
name = "unnamed" if name.size == 0
name = "unnamed" if name.empty?
return name.mb_chars.to_s
end