From d248afc3760bc3d86216239d76353b1c97de5df2 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 12 Jun 2017 16:12:03 +0200 Subject: [PATCH] Enable the Layout/ExtraSpacing cop --- .rubocop.yml | 5 ++++- app/controllers/stats_controller.rb | 2 +- .../users/dossiers/add_siret_controller.rb | 2 +- config/initializers/smart_listing.rb | 2 +- ...0160822142045_delete_value_of_filter_procedure.rb | 2 +- lib/tasks/dev.rake | 12 ++++++------ spec/controllers/users/dossiers_controller_spec.rb | 8 ++++---- spec/decorators/procedure_decorator_spec.rb | 2 +- spec/facades/admin_procedures_show_facades_spec.rb | 4 ++-- spec/features/backoffice/connection_spec.rb | 6 +++--- spec/features/backoffice/search_file_spec.rb | 4 ++-- spec/models/administrateur_spec.rb | 2 +- spec/services/accompagnateur_service_spec.rb | 2 +- .../admin/types_de_champ/show.html.haml_spec.rb | 2 +- .../types_de_champ_private/show.html.haml_spec.rb | 2 +- .../show.html.haml_spec.rb | 2 +- .../views/backoffice/dossiers/show.html.html_spec.rb | 2 +- spec/views/dossiers/_infos_dossier_spec.rb | 2 +- spec/views/users/carte/show.html.haml_spec.rb | 2 +- 19 files changed, 34 insertions(+), 31 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index cdbbfd8e0..1092ac6c6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -71,7 +71,10 @@ Layout/EndOfLine: EnforcedStyle: lf Layout/ExtraSpacing: - Enabled: false + Enabled: true + Exclude: + - "Guardfile" + - "db/schema.rb" Layout/FirstArrayElementLineBreak: Enabled: false diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index eb96939c1..5cacd22d1 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -61,7 +61,7 @@ class StatsController < ApplicationController count_per_administrateur = procedures.group(:administrateur_id).count.values { 'Une procédure' => count_per_administrateur.select { |count| count == 1 }.count, - 'Entre deux et cinq procédures' => count_per_administrateur.select { |count| 2 <= count && count <= 5 }.count, + 'Entre deux et cinq procédures' => count_per_administrateur.select { |count| 2 <= count && count <= 5 }.count, 'Plus de cinq procédures' => count_per_administrateur.select { |count| 5 < count }.count } end diff --git a/app/controllers/users/dossiers/add_siret_controller.rb b/app/controllers/users/dossiers/add_siret_controller.rb index 4190e304f..92ab6ee45 100644 --- a/app/controllers/users/dossiers/add_siret_controller.rb +++ b/app/controllers/users/dossiers/add_siret_controller.rb @@ -1,6 +1,6 @@ class Users::Dossiers::AddSiretController < ApplicationController def show - @facade = DossierFacades.new params[:dossier_id], current_user.email + @facade = DossierFacades.new params[:dossier_id], current_user.email raise ActiveRecord::RecordNotFound unless @facade.procedure.individual_with_siret? diff --git a/config/initializers/smart_listing.rb b/config/initializers/smart_listing.rb index 91d459d6d..09a097d25 100644 --- a/config/initializers/smart_listing.rb +++ b/config/initializers/smart_listing.rb @@ -10,7 +10,7 @@ SmartListing.configure do |config| # :unlimited_per_page => false, # allow infinite page size # :paginate => true, # allow pagination # :memorize_per_page => false, # save per page settings in the cookie - :page_sizes => [10, 20, 50, 100], # set available page sizes array + :page_sizes => [10, 20, 50, 100], # set available page sizes array # :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options }) diff --git a/db/migrate/20160822142045_delete_value_of_filter_procedure.rb b/db/migrate/20160822142045_delete_value_of_filter_procedure.rb index 9a369b8ed..30a12da5f 100644 --- a/db/migrate/20160822142045_delete_value_of_filter_procedure.rb +++ b/db/migrate/20160822142045_delete_value_of_filter_procedure.rb @@ -1,5 +1,5 @@ class DeleteValueOfFilterProcedure < ActiveRecord::Migration - class Gestionnaire < ActiveRecord::Base + class Gestionnaire < ActiveRecord::Base end def change diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake index 3373efb79..cd9f5eb23 100644 --- a/lib/tasks/dev.rake +++ b/lib/tasks/dev.rake @@ -1,6 +1,6 @@ namespace :dev do desc 'Initialise dev environment' - task :init do + task :init do puts 'start initialisation' Rake::Task['dev:generate_token_file'].invoke Rake::Task['dev:generate_franceconnect_file'].invoke @@ -10,10 +10,10 @@ namespace :dev do puts 'end initialisation' end - task :generate_token_file do + task :generate_token_file do puts 'creating token.rb file' res = `rake secret`.gsub("\n", '') - file = File.new('config/initializers/token.rb', 'w+') + file = File.new('config/initializers/token.rb', 'w+') comment = <