Enable the Stlye/BlockDelimiters cop

This commit is contained in:
gregoirenovel 2018-12-18 22:08:14 +01:00
parent a8f700b572
commit fba8d97256
3 changed files with 17 additions and 15 deletions

View file

@ -830,7 +830,9 @@ Style/BlockComments:
Enabled: true Enabled: true
Style/BlockDelimiters: Style/BlockDelimiters:
Enabled: false Enabled: true
Exclude:
- "spec/**/*"
Style/BracesAroundHashParameters: Style/BracesAroundHashParameters:
Enabled: false Enabled: false

View file

@ -167,13 +167,13 @@ module TagsSubstitutionConcern
end end
def types_de_champ_tags(types_de_champ, available_for_states) def types_de_champ_tags(types_de_champ, available_for_states)
types_de_champ.map { |tdc| types_de_champ.map do |tdc|
{ {
libelle: tdc.libelle, libelle: tdc.libelle,
description: tdc.description, description: tdc.description,
available_for_states: available_for_states available_for_states: available_for_states
} }
} end
end end
def replace_tags(text, dossier) def replace_tags(text, dossier)

View file

@ -22,8 +22,8 @@ namespace :cloudstorage do
Rake::Task['cloudstorage:init'].invoke Rake::Task['cloudstorage:init'].invoke
error_count = 0 error_count = 0
[Cerfa, PieceJustificative, Procedure].each { |c| [Cerfa, PieceJustificative, Procedure].each do |c|
c.all.each { |entry| c.all.each do |entry|
content = (c == Procedure) ? entry.logo : entry.content content = (c == Procedure) ? entry.logo : entry.content
if !(content.current_path.nil? || File.exist?(File.dirname(content.current_path) + '/uploaded')) if !(content.current_path.nil? || File.exist?(File.dirname(content.current_path) + '/uploaded'))
secure_token = SecureRandom.uuid secure_token = SecureRandom.uuid
@ -56,8 +56,8 @@ namespace :cloudstorage do
puts "Skipping #{content.current_path}" puts "Skipping #{content.current_path}"
end end
end end
} end
} end
puts "There were #{error_count} errors while uploading files. See upload_errors.report file for details." puts "There were #{error_count} errors while uploading files. See upload_errors.report file for details."
puts 'Enf of migration' puts 'Enf of migration'
@ -67,8 +67,8 @@ namespace :cloudstorage do
task :revert do task :revert do
Rake::Task['cloudstorage:init'].invoke Rake::Task['cloudstorage:init'].invoke
[Cerfa, PieceJustificative, Procedure].each { |c| [Cerfa, PieceJustificative, Procedure].each do |c|
c.all.each { |entry| c.all.each do |entry|
content = (c == Procedure) ? entry.logo : entry.content content = (c == Procedure) ? entry.logo : entry.content
if content.current_path.present? if content.current_path.present?
if File.exist?(File.dirname(content.current_path) + '/uploaded') if File.exist?(File.dirname(content.current_path) + '/uploaded')
@ -86,26 +86,26 @@ namespace :cloudstorage do
FileUtils.rm(File.dirname(content.current_path) + '/secure_token_cloudstorage') FileUtils.rm(File.dirname(content.current_path) + '/secure_token_cloudstorage')
end end
end end
} end
} end
end end
desc 'Clear old documents in tenant' desc 'Clear old documents in tenant'
task :clear do task :clear do
Rake::Task['cloudstorage:init'].invoke Rake::Task['cloudstorage:init'].invoke
@cont.objects.each { |object| @cont.objects.each do |object|
puts "Removing #{object}" puts "Removing #{object}"
@cont.delete_object(object) @cont.delete_object(object)
} end
end end
task :clear_old_objects do task :clear_old_objects do
Rake::Task['cloudstorage:init'].invoke Rake::Task['cloudstorage:init'].invoke
@cont.objects_detail.each { |object, details| @cont.objects_detail.each do |object, details|
last_modified = Time.zone.parse(details[:last_modified]) last_modified = Time.zone.parse(details[:last_modified])
@cont.delete_object(object) if last_modified.utc <= (Time.zone.now - 2.years).utc @cont.delete_object(object) if last_modified.utc <= (Time.zone.now - 2.years).utc
} end
end end
end end