From 62f1b9c7122c0d94adeb985157a4fd0dfe3f32be Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Mon, 28 Aug 2017 11:18:38 +0200 Subject: [PATCH] Rubocop: enable indentation width rule --- .rubocop.yml | 2 +- app/controllers/admin/attestation_templates_controller.rb | 6 +++--- app/models/concerns/credentials_syncable_concern.rb | 2 +- config/initializers/logstasher.rb | 2 +- .../20170215102943_remove_duplicate_email_received.rb | 2 +- spec/models/concern/mail_template_concern_spec.rb | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 58fe127a4..af52afe24 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -110,7 +110,7 @@ Layout/IndentationConsistency: Enabled: false Layout/IndentationWidth: - Enabled: false + Enabled: true Layout/InitialIndentation: Enabled: false diff --git a/app/controllers/admin/attestation_templates_controller.rb b/app/controllers/admin/attestation_templates_controller.rb index c49edfe13..4988fdce8 100644 --- a/app/controllers/admin/attestation_templates_controller.rb +++ b/app/controllers/admin/attestation_templates_controller.rb @@ -72,9 +72,9 @@ class Admin::AttestationTemplatesController < AdminController def uninterlaced_png(uploaded_file) if uploaded_file.present? && uploaded_file.content_type == 'image/png' - chunky_img = ChunkyPNG::Image.from_io(uploaded_file) - chunky_img.save(uploaded_file.tempfile.to_path, interlace: false) - uploaded_file.tempfile.reopen(uploaded_file.tempfile.to_path, 'rb') + chunky_img = ChunkyPNG::Image.from_io(uploaded_file) + chunky_img.save(uploaded_file.tempfile.to_path, interlace: false) + uploaded_file.tempfile.reopen(uploaded_file.tempfile.to_path, 'rb') end uploaded_file diff --git a/app/models/concerns/credentials_syncable_concern.rb b/app/models/concerns/credentials_syncable_concern.rb index f5bf6ae92..64515b393 100644 --- a/app/models/concerns/credentials_syncable_concern.rb +++ b/app/models/concerns/credentials_syncable_concern.rb @@ -1,5 +1,5 @@ module CredentialsSyncableConcern - extend ActiveSupport::Concern + extend ActiveSupport::Concern included do after_update :sync_credentials diff --git a/config/initializers/logstasher.rb b/config/initializers/logstasher.rb index 04877b73a..7d1be9caf 100644 --- a/config/initializers/logstasher.rb +++ b/config/initializers/logstasher.rb @@ -1,5 +1,5 @@ if LogStasher.enabled LogStasher.add_custom_fields do |fields| - fields[:type] = "tps" + fields[:type] = "tps" end end diff --git a/db/migrate/20170215102943_remove_duplicate_email_received.rb b/db/migrate/20170215102943_remove_duplicate_email_received.rb index ec37aaf93..907762e04 100644 --- a/db/migrate/20170215102943_remove_duplicate_email_received.rb +++ b/db/migrate/20170215102943_remove_duplicate_email_received.rb @@ -1,6 +1,6 @@ class RemoveDuplicateEmailReceived < ActiveRecord::Migration[5.0] def change - all_mails = MailReceived.all + all_mails = MailReceived.all groupped = all_mails.group_by { |m| m.procedure_id } filtered = groupped.reject { |k, v| v.length < 2 } filtered.each do |k, duplicate_mails| diff --git a/spec/models/concern/mail_template_concern_spec.rb b/spec/models/concern/mail_template_concern_spec.rb index 96f997ff4..843c4c896 100644 --- a/spec/models/concern/mail_template_concern_spec.rb +++ b/spec/models/concern/mail_template_concern_spec.rb @@ -6,7 +6,7 @@ describe MailTemplateConcern do let(:initiated_mail) { Mails::InitiatedMail.default } it 'works' do - initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--' + initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--' expected = "[TPS] #{dossier.id} #{dossier.procedure.libelle} " + "http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif"