Enable Style/WordArray

This commit is contained in:
gregoirenovel 2018-10-01 13:55:12 +02:00
parent d1439f8a52
commit 6eeba14885
19 changed files with 23 additions and 22 deletions

View file

@ -1262,7 +1262,8 @@ Style/WhileUntilModifier:
Enabled: false Enabled: false
Style/WordArray: Style/WordArray:
Enabled: false Enabled: true
EnforcedStyle: brackets
Style/YodaCondition: Style/YodaCondition:
Enabled: true Enabled: true

View file

@ -39,7 +39,7 @@ guard 'livereload' do
# less: :less, # uncomment if you want LESS stylesheets done in browser # less: :less, # uncomment if you want LESS stylesheets done in browser
} }
rails_view_exts = %w(erb haml slim) rails_view_exts = ['erb', 'haml', 'slim']
# file types LiveReload may optimize refresh for # file types LiveReload may optimize refresh for
compiled_exts = extensions.values compiled_exts = extensions.values

View file

@ -28,7 +28,7 @@ class TypeDeChampDecorator < Draper::Decorator
end end
def base_classes def base_classes
%w(btn btn-default form-control fa) ['btn', 'btn-default', 'form-control', 'fa']
end end
def display_up_button?(index, private) def display_up_button?(index, private)

View file

@ -23,7 +23,7 @@ class TypeDePieceJustificativeDecorator < Draper::Decorator
end end
def base_classes def base_classes
%w(btn btn-default form-control fa) ['btn', 'btn-default', 'form-control', 'fa']
end end
def display_up_button?(index) def display_up_button?(index)

View file

@ -2,6 +2,6 @@ module StringToHtmlHelper
def string_to_html(str) def string_to_html(str)
html_formatted = simple_format(str) html_formatted = simple_format(str)
with_links = html_formatted.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>') with_links = html_formatted.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>')
sanitize(with_links, attributes: %w(href target)) sanitize(with_links, attributes: ['href', 'target'])
end end
end end

View file

@ -174,7 +174,7 @@ class DossierFieldService
end end
def assert_valid_order(order) def assert_valid_order(order)
if !%w[asc desc].include?(order) if !["asc", "desc"].include?(order)
raise "Invalid order #{order}" raise "Invalid order #{order}"
end end
end end

View file

@ -21,7 +21,7 @@ class AttestationTemplateLogoUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded. # Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this: # For images you might use something like this:
def extension_white_list def extension_white_list
%w(jpg jpeg png) ['jpg', 'jpeg', 'png']
end end
def filename def filename

View file

@ -21,7 +21,7 @@ class AttestationTemplateSignatureUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded. # Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this: # For images you might use something like this:
def extension_white_list def extension_white_list
%w(jpg jpeg png) ['jpg', 'jpeg', 'png']
end end
def filename def filename

View file

@ -14,7 +14,7 @@ class CommentaireFileUploader < BaseUploader
end end
def extension_white_list def extension_white_list
%w(pdf doc docx xls xlsx ppt pptx odt ods odp jpg jpeg png zip txt) ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'jpg', 'jpeg', 'png', 'zip', 'txt']
end end
def accept_extension_list def accept_extension_list

View file

@ -19,7 +19,7 @@ class PieceJustificativeUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded. # Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this: # For images you might use something like this:
def extension_white_list def extension_white_list
%w(pdf doc docx xls xlsx ppt pptx odt ods odp jpg jpeg png) ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp', 'jpg', 'jpeg', 'png']
end end
def filename def filename

View file

@ -21,7 +21,7 @@ class ProcedureLogoUploader < BaseUploader
# Add a white list of extensions which are allowed to be uploaded. # Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this: # For images you might use something like this:
def extension_white_list def extension_white_list
%w(jpg jpeg png) ['jpg', 'jpeg', 'png']
end end
def filename def filename

View file

@ -24,10 +24,10 @@ module TPS
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
config.i18n.available_locales = [:fr] config.i18n.available_locales = [:fr]
config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/validators #{config.root}/app/facades) config.autoload_paths += ["#{config.root}/lib", "#{config.root}/app/validators", "#{config.root}/app/facades"]
config.assets.paths << Rails.root.join('app', 'assets', 'javascript') config.assets.paths << Rails.root.join('app', 'assets', 'javascript')
config.assets.paths << Rails.root.join('app', 'assets', 'fonts') config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
config.assets.precompile += %w(.woff) config.assets.precompile += ['.woff']
URL = ENV['APP_HOST'] || "http://localhost:3000/" URL = ENV['APP_HOST'] || "http://localhost:3000/"

View file

@ -8,4 +8,4 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets. # Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w(print.css new_design/new_application.css new_design/print.css new_design/application.js new_design/manager.css) Rails.application.config.assets.precompile += ['print.css', 'new_design/new_application.css', 'new_design/print.css', 'new_design/application.js', 'new_design/manager.css']

View file

@ -1,6 +1,6 @@
class PurgeDraftDossier < ActiveRecord::Migration class PurgeDraftDossier < ActiveRecord::Migration
class Dossier < ApplicationRecord class Dossier < ApplicationRecord
BROUILLON = %w(draft) BROUILLON = ['draft']
def brouillon? def brouillon?
BROUILLON.include?(state) BROUILLON.include?(state)

View file

@ -1,5 +1,5 @@
task :deploy do task :deploy do
domains = %w(149.202.72.152 149.202.198.6) domains = ['149.202.72.152', '149.202.198.6']
domains.each do |domain| domains.each do |domain|
sh "mina deploy domain=#{domain}" sh "mina deploy domain=#{domain}"
end end

View file

@ -113,7 +113,7 @@ describe ApplicationController, type: :controller do
it { expect(@controller).to have_received(:redirect_to).with(root_path) } it { expect(@controller).to have_received(:redirect_to).with(root_path) }
context 'when the path is safe' do context 'when the path is safe' do
%w(/ /manager /administrations).each do |path| ['/', '/manager', '/administrations'].each do |path|
let(:path_info) { path } let(:path_info) { path }
it { expect(@controller).not_to have_received(:sign_out) } it { expect(@controller).not_to have_received(:sign_out) }

View file

@ -23,7 +23,7 @@ describe Dossier do
end end
it do it do
expect(Dossier.with_champs.find(dossier.id).champs.map(&:libelle)).to match(%w(l1 l2 l3)) expect(Dossier.with_champs.find(dossier.id).champs.map(&:libelle)).to match(['l1', 'l2', 'l3'])
end end
end end
@ -379,7 +379,7 @@ describe Dossier do
create(:type_de_champ, libelle: 'l2', order_place: 2, procedure: procedure) create(:type_de_champ, libelle: 'l2', order_place: 2, procedure: procedure)
end end
it { expect(dossier.champs.pluck(:libelle)).to match(%w(l1 l2 l3)) } it { expect(dossier.champs.pluck(:libelle)).to match(['l1', 'l2', 'l3']) }
end end
describe '#champs_private' do describe '#champs_private' do
@ -392,7 +392,7 @@ describe Dossier do
create :type_de_champ, :private, libelle: 'l2', order_place: 2, procedure: procedure create :type_de_champ, :private, libelle: 'l2', order_place: 2, procedure: procedure
end end
it { expect(dossier.champs_private.pluck(:libelle)).to match(%w(l1 l2 l3)) } it { expect(dossier.champs_private.pluck(:libelle)).to match(['l1', 'l2', 'l3']) }
end end
describe '#total_follow' do describe '#total_follow' do

View file

@ -39,7 +39,7 @@ end
Capybara.register_driver :headless_chrome do |app| Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w(headless disable-gpu disable-dev-shm-usage disable-software-rasterizer mute-audio window-size=1440,900) } chromeOptions: { args: ['headless', 'disable-gpu', 'disable-dev-shm-usage', 'disable-software-rasterizer', 'mute-audio', 'window-size=1440,900'] }
) )
Capybara::Selenium::Driver.new app, Capybara::Selenium::Driver.new app,

View file

@ -1,5 +1,5 @@
RSpec.configure do |config| RSpec.configure do |config|
expect_list = %w() expect_list = []
config.before(:suite) do config.before(:suite) do
DatabaseCleaner.clean_with(:truncation, except: expect_list) DatabaseCleaner.clean_with(:truncation, except: expect_list)