Enable the Layout/ExtraSpacing cop

This commit is contained in:
gregoirenovel 2017-06-12 16:12:03 +02:00
parent f1d66e40c3
commit d248afc376
19 changed files with 34 additions and 31 deletions

View file

@ -71,7 +71,10 @@ Layout/EndOfLine:
EnforcedStyle: lf EnforcedStyle: lf
Layout/ExtraSpacing: Layout/ExtraSpacing:
Enabled: false Enabled: true
Exclude:
- "Guardfile"
- "db/schema.rb"
Layout/FirstArrayElementLineBreak: Layout/FirstArrayElementLineBreak:
Enabled: false Enabled: false

View file

@ -61,7 +61,7 @@ class StatsController < ApplicationController
count_per_administrateur = procedures.group(:administrateur_id).count.values count_per_administrateur = procedures.group(:administrateur_id).count.values
{ {
'Une procédure' => count_per_administrateur.select { |count| count == 1 }.count, '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 'Plus de cinq procédures' => count_per_administrateur.select { |count| 5 < count }.count
} }
end end

View file

@ -1,6 +1,6 @@
class Users::Dossiers::AddSiretController < ApplicationController class Users::Dossiers::AddSiretController < ApplicationController
def show 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? raise ActiveRecord::RecordNotFound unless @facade.procedure.individual_with_siret?

View file

@ -10,7 +10,7 @@ SmartListing.configure do |config|
# :unlimited_per_page => false, # allow infinite page size # :unlimited_per_page => false, # allow infinite page size
# :paginate => true, # allow pagination # :paginate => true, # allow pagination
# :memorize_per_page => false, # save per page settings in the cookie # :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 # :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
}) })

View file

@ -1,5 +1,5 @@
class DeleteValueOfFilterProcedure < ActiveRecord::Migration class DeleteValueOfFilterProcedure < ActiveRecord::Migration
class Gestionnaire < ActiveRecord::Base class Gestionnaire < ActiveRecord::Base
end end
def change def change

View file

@ -1,6 +1,6 @@
namespace :dev do namespace :dev do
desc 'Initialise dev environment' desc 'Initialise dev environment'
task :init do task :init do
puts 'start initialisation' puts 'start initialisation'
Rake::Task['dev:generate_token_file'].invoke Rake::Task['dev:generate_token_file'].invoke
Rake::Task['dev:generate_franceconnect_file'].invoke Rake::Task['dev:generate_franceconnect_file'].invoke
@ -10,10 +10,10 @@ namespace :dev do
puts 'end initialisation' puts 'end initialisation'
end end
task :generate_token_file do task :generate_token_file do
puts 'creating token.rb file' puts 'creating token.rb file'
res = `rake secret`.gsub("\n", '') res = `rake secret`.gsub("\n", '')
file = File.new('config/initializers/token.rb', 'w+') file = File.new('config/initializers/token.rb', 'w+')
comment = <<EOF comment = <<EOF
EOF EOF
file.write(comment) file.write(comment)
@ -22,7 +22,7 @@ EOF
end end
task :generate_franceconnect_file do task :generate_franceconnect_file do
file = File.new('config/france_connect.yml', 'w+') file = File.new('config/france_connect.yml', 'w+')
comment = <<EOF comment = <<EOF
particulier_identifier: plop particulier_identifier: plop
particulier_secret: plip particulier_secret: plip
@ -48,7 +48,7 @@ default:
openstack_auth_url: "https://auth.cloud.ovh.net/v2.0/tokens" openstack_auth_url: "https://auth.cloud.ovh.net/v2.0/tokens"
openstack_region: "SBG1" openstack_region: "SBG1"
EOF EOF
file = File.new("config/fog_credentials.test.yml", "w+") file = File.new("config/fog_credentials.test.yml", "w+")
file.write(content) file.write(content)
file.close file.close
end end
@ -58,7 +58,7 @@ EOF
content = <<EOF content = <<EOF
remote_storage: true remote_storage: true
EOF EOF
file = File.new("config/initializers/features.yml", "w+") file = File.new("config/initializers/features.yml", "w+")
file.write(content) file.write(content)
file.close file.close
end end

View file

@ -369,10 +369,10 @@ describe Users::DossiersController, type: :controller do
dossier.reload dossier.reload
end end
it { expect(dossier.individual.gender).to eq 'M.' } it { expect(dossier.individual.gender).to eq 'M.' }
it { expect(dossier.individual.nom).to eq 'Julien' } it { expect(dossier.individual.nom).to eq 'Julien' }
it { expect(dossier.individual.prenom).to eq 'Xavier' } it { expect(dossier.individual.prenom).to eq 'Xavier' }
it { expect(dossier.individual.birthdate).to eq '20/01/1991' } it { expect(dossier.individual.birthdate).to eq '20/01/1991' }
it { expect(dossier.procedure.for_individual).to eq true } it { expect(dossier.procedure.for_individual).to eq true }
end end

View file

@ -1,7 +1,7 @@
require 'spec_helper' require 'spec_helper'
describe ProcedureDecorator do describe ProcedureDecorator do
let(:procedure) { create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10)) } let(:procedure) { create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10)) }
subject { procedure.decorate } subject { procedure.decorate }
describe 'lien' do describe 'lien' do

View file

@ -20,7 +20,7 @@ describe AdminProceduresShowFacades do
describe '.dossiers' do describe '.dossiers' do
subject { super().dossiers } subject { super().dossiers }
it { expect(subject.size).to eq(4) } it { expect(subject.size).to eq(4) }
end end
describe '.dossiers_for_pie_highchart' do describe '.dossiers_for_pie_highchart' do
@ -34,7 +34,7 @@ describe AdminProceduresShowFacades do
it { expect(subject.size).to eq(1) } it { expect(subject.size).to eq(1) }
it { expect(subject.first.state).to eq('initiated') } it { expect(subject.first.state).to eq('initiated') }
it { expect(subject.first.total).to eq(1) } it { expect(subject.first.total).to eq(1) }
end end

View file

@ -2,7 +2,7 @@ require 'spec_helper'
feature 'when gestionnaire come to /backoffice and is not authenticated' do feature 'when gestionnaire come to /backoffice and is not authenticated' do
let(:procedure) { create(:procedure) } let(:procedure) { create(:procedure) }
let!(:dossier) { create(:dossier, procedure: procedure) } let!(:dossier) { create(:dossier, procedure: procedure) }
before do before do
visit backoffice_path visit backoffice_path
end end
@ -25,8 +25,8 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do
before do before do
create :assign_to, gestionnaire: gestionnaire, procedure: procedure create :assign_to, gestionnaire: gestionnaire, procedure: procedure
page.find_by_id(:user_email).set gestionnaire.email page.find_by_id(:user_email).set gestionnaire.email
page.find_by_id(:user_password).set gestionnaire.password page.find_by_id(:user_password).set gestionnaire.password
page.click_on 'Se connecter' page.click_on 'Se connecter'
end end
scenario 'he is redirected to /backoffice' do scenario 'he is redirected to /backoffice' do

View file

@ -39,8 +39,8 @@ feature 'search file on gestionnaire backoffice' do
end end
context 'when terms input does return result' do context 'when terms input does return result' do
let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated') } let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated') }
let!(:dossier_2) { create(:dossier, procedure: procedure, state: 'initiated') } let!(:dossier_2) { create(:dossier, procedure: procedure, state: 'initiated') }
let(:terms) { dossier.entreprise.raison_sociale } let(:terms) { dossier.entreprise.raison_sociale }

View file

@ -33,7 +33,7 @@ describe Administrateur, type: :model do
describe 'generate_api_token' do describe 'generate_api_token' do
let(:token) { 'bullshit' } let(:token) { 'bullshit' }
let(:new_token) { 'pocket_master' } let(:new_token) { 'pocket_master' }
let!(:admin_1) { create(:administrateur, email: 'toto@tps.com', password: 'password', api_token: token) } let!(:admin_1) { create(:administrateur, email: 'toto@tps.com', password: 'password', api_token: token) }
before do before do
allow(SecureRandom).to receive(:hex).and_return(token, new_token) allow(SecureRandom).to receive(:hex).and_return(token, new_token)
admin_1.renew_api_token admin_1.renew_api_token

View file

@ -7,7 +7,7 @@ describe AccompagnateurService do
let(:accompagnateur_service) { AccompagnateurService.new accompagnateur, procedure, to} let(:accompagnateur_service) { AccompagnateurService.new accompagnateur, procedure, to}
describe '#change_assignement!' do describe '#change_assignement!' do
subject { accompagnateur_service.change_assignement! } subject { accompagnateur_service.change_assignement! }
context 'when accompagnateur is not assign at the procedure' do context 'when accompagnateur is not assign at the procedure' do
let(:to) { AccompagnateurService::ASSIGN } let(:to) { AccompagnateurService::ASSIGN }

View file

@ -43,7 +43,7 @@ describe 'admin/types_de_champ/show.html.haml', type: :view do
let!(:type_de_champ_1) { create(:type_de_champ_public, procedure: procedure, order_place: 1) } let!(:type_de_champ_1) { create(:type_de_champ_public, procedure: procedure, order_place: 1) }
it { expect(subject).to have_css('#btn_down_0') } it { expect(subject).to have_css('#btn_down_0') }
it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') } it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') }
it { expect(subject).to have_css('#btn_up_1') } it { expect(subject).to have_css('#btn_up_1') }
it { expect(subject).to have_css('#btn_down_1[style*="visibility: hidden"]') } it { expect(subject).to have_css('#btn_down_1[style*="visibility: hidden"]') }
end end
end end

View file

@ -51,7 +51,7 @@ describe 'admin/types_de_champ/show.html.haml', type: :view do
let!(:type_de_champ_1) { create(:type_de_champ_private, procedure: procedure, order_place: 1) } let!(:type_de_champ_1) { create(:type_de_champ_private, procedure: procedure, order_place: 1) }
it { expect(subject).to have_css('#btn_down_0') } it { expect(subject).to have_css('#btn_down_0') }
it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') } it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') }
it { expect(subject).to have_css('#btn_up_1') } it { expect(subject).to have_css('#btn_up_1') }
it { expect(subject).to have_css('#btn_down_1[style*="visibility: hidden"]') } it { expect(subject).to have_css('#btn_down_1[style*="visibility: hidden"]') }
end end
end end

View file

@ -41,7 +41,7 @@ describe 'admin/pieces_justificatives/show.html.haml', type: :view do
let!(:type_de_piece_justificative_1) { create(:type_de_piece_justificative, procedure: procedure, order_place: 1) } let!(:type_de_piece_justificative_1) { create(:type_de_piece_justificative, procedure: procedure, order_place: 1) }
it { expect(subject).to have_css('#btn_down_0') } it { expect(subject).to have_css('#btn_down_0') }
it { expect(subject).not_to have_css('#btn_up_0') } it { expect(subject).not_to have_css('#btn_up_0') }
it { expect(subject).to have_css('#btn_up_1') } it { expect(subject).to have_css('#btn_up_1') }
it { expect(subject).not_to have_css('#btn_down_1') } it { expect(subject).not_to have_css('#btn_down_1') }
end end
end end

View file

@ -1,7 +1,7 @@
require 'spec_helper' require 'spec_helper'
describe 'backoffice/dossiers/show.html.haml', type: :view do describe 'backoffice/dossiers/show.html.haml', type: :view do
let!(:dossier) { create(:dossier, :with_entreprise, state: state) } let!(:dossier) { create(:dossier, :with_entreprise, state: state) }
let(:state) { 'draft' } let(:state) { 'draft' }
let(:dossier_id) { dossier.id } let(:dossier_id) { dossier.id }
let(:gestionnaire) { create(:gestionnaire) } let(:gestionnaire) { create(:gestionnaire) }

View file

@ -1,7 +1,7 @@
require 'spec_helper' require 'spec_helper'
describe 'dossiers/_infos_dossier.html.haml', type: :view do describe 'dossiers/_infos_dossier.html.haml', type: :view do
let(:dossier) { create(:dossier, :with_entreprise, procedure: create(:procedure, :with_api_carto, :with_type_de_champ)) } let(:dossier) { create(:dossier, :with_entreprise, procedure: create(:procedure, :with_api_carto, :with_type_de_champ)) }
before do before do
champs.each do |champ| champs.each do |champ|

View file

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'users/carte/show.html.haml', type: :view do describe 'users/carte/show.html.haml', type: :view do
let(:state) { 'draft' } let(:state) { 'draft' }
let(:dossier) { create(:dossier, state: state) } let(:dossier) { create(:dossier, state: state) }
let(:dossier_id) { dossier.id } let(:dossier_id) { dossier.id }
before do before do