From 1ae0c73920596c0d1f74d2b6eb274f856a2ee54c Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 29 Oct 2022 08:06:14 +0000 Subject: [PATCH] Update RuboCop Rails to 2.17 (#37248). git-svn-id: https://svn.redmine.org/redmine/trunk@21931 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop.yml | 23 +++++++++++++++++++++++ .rubocop_todo.yml | 11 ++++++----- Gemfile | 2 +- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 83ce7a33e..aa6ea904b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -116,6 +116,21 @@ Naming/BinaryOperatorParameterName: Naming/PredicateName: Enabled: false +Rails/ActionControllerFlashBeforeRender: + # False positive in actions where `redirect_to_referer_or` is used + Enabled: false + +Rails/ActionControllerTestCase: + Enabled: false + +Rails/ActionOrder: + Enabled: false + +Rails/ActiveSupportOnLoad: + Exclude: + # TODO: Need to check the impact on plugins. Disable for now. + - 'lib/redmine/preparation.rb' + Rails/BulkChangeTable: Exclude: - 'db/migrate/20120714122200_add_workflows_rule_fields.rb' @@ -136,6 +151,14 @@ Rails/FilePath: Rails/HelperInstanceVariable: Enabled: false +Rails/Pluck: + Exclude: + # `pluck` is not available in Gemfile + - 'Gemfile' + +Rails/RootPathnameMethods: + Enabled: false + Rails/SquishedSQLHeredocs: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4ce803621..7a601f12e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -657,9 +657,9 @@ Rails/DuplicateScope: # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers. -# Whitelist: find_by_sql -# AllowedMethods: find_by_sql -# AllowedReceivers: Gem::Specification +# Whitelist: find_by_sql, find_by_token_for +# AllowedMethods: find_by_sql, find_by_token_for +# AllowedReceivers: Gem::Specification, page Rails/DynamicFindBy: Enabled: false @@ -677,8 +677,9 @@ Rails/Exit: - 'config/routes.rb' # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include, IgnoredMethods. +# Configuration parameters: Include, AllowedMethods, AllowedPatterns, IgnoredMethods. # Include: app/models/**/*.rb +# AllowedMethods: order, limit, select, lock # IgnoredMethods: order, limit, select, lock Rails/FindEach: Exclude: @@ -1729,7 +1730,7 @@ Style/SymbolArray: # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowComments. -# AllowedMethods: respond_to, define_method +# AllowedMethods: define_method, mail, respond_to Style/SymbolProc: Enabled: false diff --git a/Gemfile b/Gemfile index 589ace7ea..c7d39062c 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ group :test do # RuboCop gem 'rubocop', '~> 1.37.1' gem 'rubocop-performance', '~> 1.15.0' - gem 'rubocop-rails', '~> 2.15.0' + gem 'rubocop-rails', '~> 2.17.2' end local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") -- 2.39.5