]> source.dussan.org Git - redmine.git/commitdiff
Update RuboCop Rails to 2.17 (#37248).
authorGo MAEDA <maeda@farend.jp>
Sat, 29 Oct 2022 08:06:14 +0000 (08:06 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 29 Oct 2022 08:06:14 +0000 (08:06 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@21931 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop.yml
.rubocop_todo.yml
Gemfile

index 83ce7a33e4bd2e721c61bbbcefecc3c96b84a467..aa6ea904bf72fd5c7be5d3377a31b80853f89a08 100644 (file)
@@ -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
 
index 4ce803621151f75bcb0d0d18eddb66b70de7423b..7a601f12edc92797f756ce25929767e7af4ae302 100644 (file)
@@ -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 589ace7eadd7103cc8b460c00b8df10731e16ce5..c7d39062ce54a66649adf5edb35e6d8032d2bf78 100644 (file)
--- 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")