]> source.dussan.org Git - redmine.git/commitdiff
Update RuboCop to 1.5.2 (#32530).
authorGo MAEDA <maeda@farend.jp>
Sun, 6 Dec 2020 00:31:36 +0000 (00:31 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 6 Dec 2020 00:31:36 +0000 (00:31 +0000)
Note: RubooCop 1.5.0 and 1.5.1 cannot be used for Redmine. This is because those versions of RuboCop requires regexp_parser >= 2.0 while Capybara requires regexp_parser ~> 1.5.

git-svn-id: http://svn.redmine.org/redmine/trunk@20579 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop.yml
.rubocop_todo.yml
Gemfile

index 442efa80bb3e3352d291ea3cfccf501f35b8e756..1d6cc8fb57d8e0483a40d680e301bdf7915a4f4f 100644 (file)
@@ -99,6 +99,10 @@ Metrics:
 Naming/AccessorMethodName:
   Enabled: false
 
+Naming/VariableNumber:
+  CheckMethodNames: false
+  CheckSymbols: false
+
 Naming/BinaryOperatorParameterName:
   Enabled: false
 
@@ -162,6 +166,9 @@ Style/IdenticalConditionalBranches:
     - 'config/initializers/10-patches.rb'
     - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
 
+Style/NegatedIfElseCondition:
+  Enabled: false
+
 Style/RaiseArgs:
   Enabled: false
 
index c5977efec14cdcdfe153acef78a069a02f808c24..a536c96092d64d4abfaccb4b85a110d7c3874dcb 100644 (file)
@@ -1,6 +1,6 @@
 # This configuration was generated by
 # `rubocop --auto-gen-config --exclude-limit 20 --no-offense-counts --no-auto-gen-timestamp`
-# using RuboCop version 1.0.0.
+# using RuboCop version 1.5.2.
 # The point is for the user to remove these configuration records
 # one by one as the offenses are removed from the code base.
 # Note that changes in the inspected code, or installation of new
@@ -23,6 +23,12 @@ Layout/EmptyLineAfterGuardClause:
     - 'lib/redmine/safe_attributes.rb'
     - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
 
+# Cop supports --auto-correct.
+# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
+Layout/EmptyLineBetweenDefs:
+  Exclude:
+    - 'config/initializers/10-patches.rb'
+
 # Cop supports --auto-correct.
 Layout/EmptyLines:
   Exclude:
@@ -298,6 +304,22 @@ Lint/DeprecatedClassMethods:
     - 'test/unit/attachment_test.rb'
     - 'test/unit/issue_import_test.rb'
 
+Lint/DuplicateBranch:
+  Exclude:
+    - 'app/helpers/queries_helper.rb'
+    - 'app/models/issue.rb'
+    - 'lib/redmine/sudo_mode.rb'
+
+# Configuration parameters: AllowComments, AllowEmptyLambdas.
+Lint/EmptyBlock:
+  Exclude:
+    - 'app/controllers/issues_controller.rb'
+    - 'app/models/auth_source_ldap.rb'
+    - 'lib/redmine/scm/adapters/abstract_adapter.rb'
+    - 'test/helpers/application_helper_test.rb'
+    - 'test/unit/lib/redmine/menu_manager/menu_item_test.rb'
+    - 'test/unit/lib/redmine/plugin_test.rb'
+
 Lint/FloatComparison:
   Exclude:
     - 'app/models/time_entry.rb'
@@ -334,6 +356,10 @@ Lint/NonDeterministicRequireOrder:
   Exclude:
     - 'lib/redmine/core_ext.rb'
 
+Lint/OutOfRangeRegexpRef:
+  Exclude:
+    - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
+
 # Cop supports --auto-correct.
 Lint/ParenthesesAsGroupedExpression:
   Exclude:
@@ -455,8 +481,9 @@ Naming/VariableName:
     - 'lib/redmine/scm/adapters/cvs_adapter.rb'
     - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
 
-# Configuration parameters: EnforcedStyle.
+# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
 # SupportedStyles: snake_case, normalcase, non_integer
+# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
 Naming/VariableNumber:
   Exclude:
     - 'test/functional/versions_controller_test.rb'
@@ -630,7 +657,6 @@ Rails/DynamicFindBy:
 # Include: app/**/*.rb, config/**/*.rb, lib/**/*.rb
 Rails/Exit:
   Exclude:
-    - 'lib/**/*.rake'
     - 'config/environment.rb'
     - 'config/initializers/10-patches.rb'
     - 'config/routes.rb'
@@ -1068,6 +1094,13 @@ Style/ClassVars:
     - 'lib/redmine/wiki_formatting/markdown/formatter.rb'
     - 'test/helpers/activities_helper_test.rb'
 
+# Cop supports --auto-correct.
+Style/CollectionCompact:
+  Exclude:
+    - 'app/controllers/issues_controller.rb'
+    - 'app/controllers/projects_controller.rb'
+    - 'lib/redmine/sudo_mode.rb'
+
 # Cop supports --auto-correct.
 Style/ColonMethodCall:
   Exclude:
@@ -1092,9 +1125,14 @@ Style/CombinableLoops:
 Style/ConditionalAssignment:
   Enabled: false
 
+Style/DocumentDynamicEvalDefinition:
+  Exclude:
+    - 'app/helpers/attachments_helper.rb'
+
 Style/Documentation:
   Enabled: false
 
+# Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle.
 # SupportedStyles: allowed_in_returns, forbidden
 Style/DoubleNegation:
@@ -1206,6 +1244,7 @@ Style/HashEachMethods:
     - 'test/functional/issues_custom_fields_visibility_test.rb'
     - 'test/unit/auth_source_ldap_test.rb'
 
+# Cop supports --auto-correct.
 # Configuration parameters: AllowIfModifier.
 Style/IfInsideElse:
   Exclude:
@@ -1310,11 +1349,10 @@ Style/MultilineTernaryOperator:
     - 'lib/redmine/ciphering.rb'
     - 'lib/redmine/scm/adapters/filesystem_adapter.rb'
 
+# Cop supports --auto-correct.
 Style/MultipleComparison:
   Exclude:
     - 'app/helpers/application_helper.rb'
-    - 'app/helpers/workflows_helper.rb'
-    - 'app/models/import.rb'
     - 'app/models/version.rb'
     - 'app/models/wiki_page.rb'
 
@@ -1434,6 +1472,15 @@ Style/PreferredHashMethods:
 Style/Proc:
   Enabled: false
 
+# Configuration parameters: Methods.
+Style/RedundantArgument:
+  Exclude:
+    - 'app/controllers/account_controller.rb'
+    - 'lib/redmine/scm/adapters/cvs_adapter.rb'
+    - 'lib/redmine/scm/adapters/git_adapter.rb'
+    - 'test/functional/projects_controller_test.rb'
+    - 'test/unit/issue_test.rb'
+
 # Cop supports --auto-correct.
 Style/RedundantAssignment:
   Exclude:
@@ -1587,6 +1634,7 @@ Style/Semicolon:
 Style/SingleLineMethods:
   Enabled: false
 
+# Cop supports --auto-correct.
 # Configuration parameters: AllowModifier.
 Style/SoleNestedConditional:
   Exclude:
diff --git a/Gemfile b/Gemfile
index c70f491d26b111bf21c7494ebe0bf1cf0a09ffe0..89c8a8f5317c7e322a575031b14c52ed54bcccbd 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -92,7 +92,7 @@ group :test do
   gem 'capybara', '~> 3.31.0'
   gem "selenium-webdriver"
   # RuboCop
-  gem 'rubocop', '~> 1.0.0'
+  gem 'rubocop', '~> 1.5.2'
   gem 'rubocop-performance', '~> 1.8.0'
   gem 'rubocop-rails', '~> 2.8.0'
 end