2019-06-19 02:49:28 +02:00
|
|
|
inherit_from: .rubocop_todo.yml
|
|
|
|
|
|
|
|
AllCops:
|
2022-05-28 00:26:48 +02:00
|
|
|
TargetRubyVersion: 2.6
|
2021-04-03 03:38:03 +02:00
|
|
|
TargetRailsVersion: 6.1
|
2019-06-19 02:49:28 +02:00
|
|
|
|
2020-10-23 02:47:03 +02:00
|
|
|
NewCops: enable
|
|
|
|
|
2019-06-19 02:49:28 +02:00
|
|
|
Exclude:
|
|
|
|
- '**/vendor/**/*'
|
|
|
|
- '**/tmp/**/*'
|
|
|
|
- '**/bin/**/*'
|
|
|
|
- '**/plugins/**/*'
|
|
|
|
- '**/extra/**/*'
|
|
|
|
- '**/lib/generators/**/templates/*'
|
|
|
|
- '**/lib/tasks/**/*'
|
|
|
|
- '**/files/**/*'
|
2019-10-16 15:00:18 +02:00
|
|
|
- 'db/schema.rb'
|
2019-06-19 02:49:28 +02:00
|
|
|
|
|
|
|
# Enable extensions
|
|
|
|
|
2019-06-27 01:37:09 +02:00
|
|
|
require:
|
2019-08-18 16:40:47 +02:00
|
|
|
- rubocop-performance
|
2019-06-27 01:37:09 +02:00
|
|
|
- rubocop-rails
|
2019-06-19 02:49:28 +02:00
|
|
|
|
|
|
|
# Rules for Redmine
|
|
|
|
|
2019-10-23 06:57:44 +02:00
|
|
|
Bundler/OrderedGems:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-11-20 18:05:13 +01:00
|
|
|
Layout/CaseIndentation:
|
|
|
|
Exclude:
|
|
|
|
- 'config/initializers/10-patches.rb'
|
2020-11-22 14:44:22 +01:00
|
|
|
|
2020-12-04 14:58:34 +01:00
|
|
|
Layout/ClosingParenthesisIndentation:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
|
|
|
|
2020-11-22 14:44:22 +01:00
|
|
|
Layout/EmptyLinesAroundAccessModifier:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'config/initializers/10-patches.rb'
|
2019-11-20 18:05:13 +01:00
|
|
|
|
2019-10-14 20:57:13 +02:00
|
|
|
Layout/EmptyLineBetweenDefs:
|
|
|
|
AllowAdjacentOneLineDefs: true
|
|
|
|
|
2020-12-17 14:10:40 +01:00
|
|
|
Layout/FirstHashElementIndentation:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
|
|
|
|
2020-12-11 15:17:11 +01:00
|
|
|
Layout/LineLength:
|
|
|
|
Enabled: true
|
2022-05-01 07:51:51 +02:00
|
|
|
AllowedPatterns: ['\A\s+test \".+\" do\z', '\A\s*\#']
|
2020-12-11 15:17:11 +01:00
|
|
|
Exclude:
|
|
|
|
- 'db/migrate/0*.rb'
|
|
|
|
- 'db/migrate/1*.rb'
|
|
|
|
- 'db/migrate/201*.rb'
|
|
|
|
- 'db/migrate/20200*.rb'
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
|
|
|
|
2020-11-22 14:44:39 +01:00
|
|
|
Layout/RescueEnsureAlignment:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb'
|
|
|
|
|
2020-10-23 02:47:03 +02:00
|
|
|
Layout/SpaceAroundEqualsInParameterDefault:
|
|
|
|
Enabled: false
|
|
|
|
|
2020-11-22 14:44:32 +01:00
|
|
|
Layout/SpaceBeforeSemicolon:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'config/initializers/10-patches.rb'
|
|
|
|
|
2019-06-19 02:49:28 +02:00
|
|
|
Layout/SpaceBeforeBlockBraces:
|
2019-10-26 14:53:48 +02:00
|
|
|
# "space" is used more than "no_space".
|
|
|
|
# But "no_space" is more natural in one liner.
|
|
|
|
# str = path.to_s.split(%r{[/\\]}).select{|p| !p.blank?}.join("/")
|
|
|
|
Enabled: false
|
2019-06-19 02:49:28 +02:00
|
|
|
|
2019-08-25 17:33:53 +02:00
|
|
|
Layout/SpaceInsideBlockBraces:
|
2021-02-17 13:35:36 +01:00
|
|
|
Enabled: false
|
2019-08-25 17:33:53 +02:00
|
|
|
|
2019-10-03 02:08:02 +02:00
|
|
|
Layout/SpaceInsideHashLiteralBraces:
|
2021-02-17 13:38:41 +01:00
|
|
|
Enabled: false
|
2019-10-03 02:08:02 +02:00
|
|
|
|
2020-04-05 07:45:22 +02:00
|
|
|
Lint/RaiseException:
|
|
|
|
Enabled: true
|
|
|
|
|
|
|
|
Lint/StructNewOverride:
|
|
|
|
Enabled: true
|
|
|
|
|
2019-11-29 08:36:15 +01:00
|
|
|
Lint/SuppressedException:
|
|
|
|
AllowComments: true
|
|
|
|
|
2022-06-30 11:42:33 +02:00
|
|
|
Layout/LineContinuationLeadingSpace:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-08-03 09:50:03 +02:00
|
|
|
Layout/TrailingWhitespace:
|
|
|
|
AllowInHeredoc: true
|
|
|
|
|
2019-06-20 15:20:02 +02:00
|
|
|
Metrics:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-09-25 06:35:40 +02:00
|
|
|
Naming/AccessorMethodName:
|
|
|
|
Enabled: false
|
|
|
|
|
2020-12-06 01:31:36 +01:00
|
|
|
Naming/VariableNumber:
|
|
|
|
CheckMethodNames: false
|
|
|
|
CheckSymbols: false
|
|
|
|
|
2019-09-21 16:11:19 +02:00
|
|
|
Naming/BinaryOperatorParameterName:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-09-13 04:25:23 +02:00
|
|
|
Naming/PredicateName:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-10-29 10:06:14 +02:00
|
|
|
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'
|
|
|
|
|
2019-06-19 02:49:28 +02:00
|
|
|
Rails/BulkChangeTable:
|
|
|
|
Exclude:
|
|
|
|
- 'db/migrate/20120714122200_add_workflows_rule_fields.rb'
|
|
|
|
- 'db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb'
|
|
|
|
|
2021-12-29 07:30:19 +01:00
|
|
|
Rails/CompactBlank:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-07-17 02:00:25 +02:00
|
|
|
Rails/Delegate:
|
|
|
|
Enabled: false
|
|
|
|
|
2021-05-07 06:36:16 +02:00
|
|
|
Rails/EnvironmentVariableAccess:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-01-03 03:23:27 +01:00
|
|
|
Rails/FilePath:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-09-21 16:11:07 +02:00
|
|
|
Rails/HelperInstanceVariable:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-10-29 10:06:14 +02:00
|
|
|
Rails/Pluck:
|
|
|
|
Exclude:
|
|
|
|
# `pluck` is not available in Gemfile
|
|
|
|
- 'Gemfile'
|
|
|
|
|
|
|
|
Rails/RootPathnameMethods:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-09-19 08:36:17 +02:00
|
|
|
Rails/SquishedSQLHeredocs:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-10-20 10:39:24 +02:00
|
|
|
Rails/WhereExists:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-10-09 04:05:49 +02:00
|
|
|
Style/AsciiComments:
|
|
|
|
Exclude:
|
|
|
|
# Copyright credit has non ascii character.
|
|
|
|
# We can not change nor remove it.
|
|
|
|
- 'app/models/repository/git.rb'
|
|
|
|
|
2020-12-12 16:50:29 +01:00
|
|
|
Style/BlockComments:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
2021-10-27 22:42:10 +02:00
|
|
|
- 'lib/redmine/string_array_diff/diff.rb'
|
|
|
|
- 'lib/redmine/string_array_diff/diffable.rb'
|
2020-12-12 16:50:29 +01:00
|
|
|
|
2020-11-22 14:44:55 +01:00
|
|
|
Style/BlockDelimiters:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'db/migrate/007_create_journals.rb'
|
2021-10-27 22:42:10 +02:00
|
|
|
- 'lib/redmine/string_array_diff/diff.rb'
|
|
|
|
- 'lib/redmine/string_array_diff/diffable.rb'
|
2020-11-22 14:44:55 +01:00
|
|
|
|
2022-05-01 07:51:51 +02:00
|
|
|
Style/FetchEnvVar:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-11-20 18:05:35 +01:00
|
|
|
Style/EmptyElse:
|
|
|
|
EnforcedStyle: empty
|
|
|
|
|
2020-04-05 06:29:28 +02:00
|
|
|
Style/FormatString:
|
|
|
|
EnforcedStyle: sprintf
|
|
|
|
|
2019-10-01 05:18:39 +02:00
|
|
|
Style/FormatStringToken:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-06-19 02:49:28 +02:00
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
Enabled: true
|
|
|
|
EnforcedStyle: always
|
|
|
|
Exclude:
|
|
|
|
- 'db/**/*.rb'
|
|
|
|
- 'Gemfile'
|
|
|
|
- 'Rakefile'
|
|
|
|
- 'config.ru'
|
|
|
|
- 'config/additional_environment.rb'
|
|
|
|
|
2022-01-03 03:23:27 +01:00
|
|
|
Style/GlobalStdStream:
|
|
|
|
Enabled: false
|
|
|
|
|
2020-02-19 14:45:34 +01:00
|
|
|
Style/HashEachMethods:
|
|
|
|
Enabled: true
|
|
|
|
|
2019-06-19 02:49:28 +02:00
|
|
|
Style/HashSyntax:
|
|
|
|
Enabled: true
|
|
|
|
EnforcedStyle: no_mixed_keys
|
2019-10-15 19:25:53 +02:00
|
|
|
|
2020-02-19 14:45:34 +01:00
|
|
|
Style/HashTransformKeys:
|
|
|
|
Enabled: true
|
|
|
|
|
|
|
|
Style/HashTransformValues:
|
|
|
|
Enabled: true
|
|
|
|
|
2019-10-15 19:25:53 +02:00
|
|
|
Style/IdenticalConditionalBranches:
|
|
|
|
Exclude:
|
|
|
|
- 'config/initializers/10-patches.rb'
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
2019-10-16 15:00:29 +02:00
|
|
|
|
2020-12-06 01:31:36 +01:00
|
|
|
Style/NegatedIfElseCondition:
|
|
|
|
Enabled: false
|
|
|
|
|
2020-10-23 02:47:03 +02:00
|
|
|
Style/RaiseArgs:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-09-19 07:46:24 +02:00
|
|
|
Style/Semicolon:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-05-28 00:26:48 +02:00
|
|
|
Style/SlicingWithRange:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-09-27 11:11:10 +02:00
|
|
|
Style/SoleNestedConditional:
|
|
|
|
Enabled: false
|
|
|
|
|
2022-09-03 08:23:18 +02:00
|
|
|
Style/TernaryParentheses:
|
|
|
|
Enabled: false
|
|
|
|
|
2019-10-16 15:00:29 +02:00
|
|
|
Style/TrailingCommaInArrayLiteral:
|
|
|
|
Enabled: false
|
2019-11-20 18:12:40 +01:00
|
|
|
|
|
|
|
Style/TrailingCommaInHashLiteral:
|
|
|
|
Enabled: false
|