2019-06-19 00:49:28 +00:00
|
|
|
inherit_from: .rubocop_todo.yml
|
|
|
|
|
|
|
|
|
|
AllCops:
|
2025-04-20 07:55:11 +00:00
|
|
|
TargetRubyVersion: 3.2
|
2024-08-20 09:15:56 +00:00
|
|
|
TargetRailsVersion: 7.2
|
2019-06-19 00:49:28 +00:00
|
|
|
|
2020-10-23 00:47:03 +00:00
|
|
|
NewCops: enable
|
|
|
|
|
|
2019-06-19 00:49:28 +00:00
|
|
|
Exclude:
|
|
|
|
|
- '**/vendor/**/*'
|
|
|
|
|
- '**/tmp/**/*'
|
|
|
|
|
- '**/bin/**/*'
|
|
|
|
|
- '**/plugins/**/*'
|
|
|
|
|
- '**/extra/**/*'
|
|
|
|
|
- '**/lib/generators/**/templates/*'
|
|
|
|
|
- '**/lib/tasks/**/*'
|
|
|
|
|
- '**/files/**/*'
|
2019-10-16 13:00:18 +00:00
|
|
|
- 'db/schema.rb'
|
2019-06-19 00:49:28 +00:00
|
|
|
|
2025-04-12 03:34:27 +00:00
|
|
|
plugins:
|
|
|
|
|
- rubocop-performance
|
2025-04-12 03:43:01 +00:00
|
|
|
- rubocop-rails
|
2025-04-12 03:34:27 +00:00
|
|
|
|
2019-06-19 00:49:28 +00:00
|
|
|
# Rules for Redmine
|
|
|
|
|
|
2019-10-23 04:57:44 +00:00
|
|
|
Bundler/OrderedGems:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-11-20 17:05:13 +00:00
|
|
|
Layout/CaseIndentation:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'config/initializers/10-patches.rb'
|
2020-11-22 13:44:22 +00:00
|
|
|
|
2020-12-04 13:58:34 +00:00
|
|
|
Layout/ClosingParenthesisIndentation:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
|
|
|
|
|
2020-11-22 13:44:22 +00:00
|
|
|
Layout/EmptyLinesAroundAccessModifier:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'config/initializers/10-patches.rb'
|
2019-11-20 17:05:13 +00:00
|
|
|
|
2019-10-14 18:57:13 +00:00
|
|
|
Layout/EmptyLineBetweenDefs:
|
|
|
|
|
AllowAdjacentOneLineDefs: true
|
|
|
|
|
|
2020-12-17 13:10:40 +00:00
|
|
|
Layout/FirstHashElementIndentation:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
|
|
|
|
|
2020-12-11 14:17:11 +00:00
|
|
|
Layout/LineLength:
|
2022-05-01 05:51:51 +00:00
|
|
|
AllowedPatterns: ['\A\s+test \".+\" do\z', '\A\s*\#']
|
2020-12-11 14:17:11 +00: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 13:44:39 +00:00
|
|
|
Layout/RescueEnsureAlignment:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb'
|
|
|
|
|
|
2020-10-23 00:47:03 +00:00
|
|
|
Layout/SpaceAroundEqualsInParameterDefault:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2020-11-22 13:44:32 +00:00
|
|
|
Layout/SpaceBeforeSemicolon:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'config/initializers/10-patches.rb'
|
|
|
|
|
|
2019-06-19 00:49:28 +00:00
|
|
|
Layout/SpaceBeforeBlockBraces:
|
2019-10-26 12:53:48 +00: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 00:49:28 +00:00
|
|
|
|
2023-08-09 23:42:42 +00:00
|
|
|
Layout/SpaceBeforeFirstArg:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-08-25 15:33:53 +00:00
|
|
|
Layout/SpaceInsideBlockBraces:
|
2021-02-17 12:35:36 +00:00
|
|
|
Enabled: false
|
2019-08-25 15:33:53 +00:00
|
|
|
|
2019-10-03 00:08:02 +00:00
|
|
|
Layout/SpaceInsideHashLiteralBraces:
|
2021-02-17 12:38:41 +00:00
|
|
|
Enabled: false
|
2019-10-03 00:08:02 +00:00
|
|
|
|
2023-03-24 09:47:19 +00:00
|
|
|
Lint/MissingSuper:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'lib/redmine/views/builders/structure.rb'
|
|
|
|
|
|
2019-11-29 07:36:15 +00:00
|
|
|
Lint/SuppressedException:
|
|
|
|
|
AllowComments: true
|
|
|
|
|
|
2025-04-11 08:44:08 +00:00
|
|
|
Lint/UselessConstantScoping:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'app/controllers/repositories_controller.rb'
|
|
|
|
|
- 'app/models/mail_handler.rb'
|
|
|
|
|
- 'lib/redmine/acts/mentionable.rb'
|
|
|
|
|
- 'lib/redmine/asset_path.rb'
|
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
|
|
|
|
|
2022-06-30 09:42:33 +00:00
|
|
|
Layout/LineContinuationLeadingSpace:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-08-03 07:50:03 +00:00
|
|
|
Layout/TrailingWhitespace:
|
|
|
|
|
AllowInHeredoc: true
|
|
|
|
|
|
2019-06-20 13:20:02 +00:00
|
|
|
Metrics:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-09-25 04:35:40 +00:00
|
|
|
Naming/AccessorMethodName:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2020-12-06 00:31:36 +00:00
|
|
|
Naming/VariableNumber:
|
|
|
|
|
CheckMethodNames: false
|
|
|
|
|
CheckSymbols: false
|
|
|
|
|
|
2019-09-21 14:11:19 +00:00
|
|
|
Naming/BinaryOperatorParameterName:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2025-06-08 02:23:01 +00:00
|
|
|
Naming/PredicateMethod:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
|
|
Naming/PredicatePrefix:
|
2019-09-13 02:25:23 +00:00
|
|
|
Enabled: false
|
|
|
|
|
|
2023-01-11 13:25:07 +00:00
|
|
|
Performance/CollectionLiteralInLoop:
|
|
|
|
|
MinSize: 4
|
|
|
|
|
|
2022-10-29 08:06:14 +00: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'
|
|
|
|
|
|
2024-01-23 11:52:38 +00:00
|
|
|
Rails/ApplicationRecord:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/migrate/0*.rb'
|
|
|
|
|
|
2019-06-19 00:49:28 +00:00
|
|
|
Rails/BulkChangeTable:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/migrate/20120714122200_add_workflows_rule_fields.rb'
|
2024-05-06 20:28:31 +00:00
|
|
|
- 'db/migrate/20130217094251_remove_issues_default_fk_values.rb'
|
2019-06-19 00:49:28 +00:00
|
|
|
- 'db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb'
|
2024-05-06 20:05:28 +00:00
|
|
|
- 'db/migrate/20190510070108_add_unique_id_to_import_items.rb'
|
|
|
|
|
- 'db/migrate/20200826153402_add_totp_to_user.rb'
|
|
|
|
|
- 'db/migrate/20221012135202_add_index_to_custom_values.rb'
|
2019-06-19 00:49:28 +00:00
|
|
|
|
2021-12-29 06:30:19 +00:00
|
|
|
Rails/CompactBlank:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-07-17 00:00:25 +00:00
|
|
|
Rails/Delegate:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2021-05-07 04:36:16 +00:00
|
|
|
Rails/EnvironmentVariableAccess:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-01-03 02:23:27 +00:00
|
|
|
Rails/FilePath:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2023-10-13 02:06:54 +00:00
|
|
|
Rails/FindEach:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-09-21 14:11:07 +00:00
|
|
|
Rails/HelperInstanceVariable:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2025-06-08 07:47:02 +00:00
|
|
|
Rails/Output:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'config/routes.rb'
|
|
|
|
|
- 'lib/redmine/diff.rb'
|
|
|
|
|
- 'lib/redmine/diff_table.rb'
|
|
|
|
|
- 'test/unit/lib/redmine/scm/adapters/*.rb'
|
|
|
|
|
|
2022-10-29 08:06:14 +00:00
|
|
|
Rails/Pluck:
|
|
|
|
|
Exclude:
|
|
|
|
|
# `pluck` is not available in Gemfile
|
|
|
|
|
- 'Gemfile'
|
|
|
|
|
|
|
|
|
|
Rails/RootPathnameMethods:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2024-09-06 05:24:25 +00:00
|
|
|
Rails/SkipsModelValidations:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-09-19 06:36:17 +00:00
|
|
|
Rails/SquishedSQLHeredocs:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2023-04-16 11:51:01 +00:00
|
|
|
Rails/ThreeStateBooleanColumn:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/migrate/009_add_hide_mail_pref.rb'
|
|
|
|
|
- 'db/migrate/059_add_roles_assignable.rb'
|
|
|
|
|
- 'db/migrate/082_add_messages_locked.rb'
|
|
|
|
|
- 'db/migrate/086_add_custom_fields_searchable.rb'
|
|
|
|
|
- 'db/migrate/102_add_custom_fields_editable.rb'
|
|
|
|
|
- 'db/migrate/20120115143100_add_repositories_is_default.rb'
|
|
|
|
|
- 'db/migrate/20120127174243_add_custom_fields_multiple.rb'
|
|
|
|
|
- 'db/migrate/20210704125704_add_twofa_required_to_groups.rb'
|
|
|
|
|
|
2022-10-20 08:39:24 +00:00
|
|
|
Rails/WhereExists:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-10-09 02:05:49 +00:00
|
|
|
Style/AsciiComments:
|
|
|
|
|
Exclude:
|
|
|
|
|
# Copyright credit has non ascii character.
|
|
|
|
|
# We can not change nor remove it.
|
|
|
|
|
- 'app/models/repository/git.rb'
|
|
|
|
|
|
2025-04-12 05:09:41 +00:00
|
|
|
Style/BarePercentLiterals:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2020-12-12 15:50:29 +00:00
|
|
|
Style/BlockComments:
|
|
|
|
|
Exclude:
|
2021-10-27 20:42:10 +00:00
|
|
|
- 'lib/redmine/string_array_diff/diff.rb'
|
|
|
|
|
- 'lib/redmine/string_array_diff/diffable.rb'
|
2020-12-12 15:50:29 +00:00
|
|
|
|
2020-11-22 13:44:55 +00:00
|
|
|
Style/BlockDelimiters:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/migrate/007_create_journals.rb'
|
2021-10-27 20:42:10 +00:00
|
|
|
- 'lib/redmine/string_array_diff/diff.rb'
|
|
|
|
|
- 'lib/redmine/string_array_diff/diffable.rb'
|
2020-11-22 13:44:55 +00:00
|
|
|
|
2025-06-08 02:23:01 +00:00
|
|
|
Style/EmptyStringInsideInterpolation:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-05-01 05:51:51 +00:00
|
|
|
Style/FetchEnvVar:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-11-20 17:05:35 +00:00
|
|
|
Style/EmptyElse:
|
|
|
|
|
EnforcedStyle: empty
|
|
|
|
|
|
2020-04-05 04:29:28 +00:00
|
|
|
Style/FormatString:
|
2024-07-22 08:17:27 +00:00
|
|
|
Enabled: false
|
2020-04-05 04:29:28 +00:00
|
|
|
|
2019-10-01 03:18:39 +00:00
|
|
|
Style/FormatStringToken:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-06-19 00:49:28 +00:00
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
|
EnforcedStyle: always
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/**/*.rb'
|
|
|
|
|
- 'Gemfile'
|
|
|
|
|
- 'Rakefile'
|
|
|
|
|
- 'config.ru'
|
|
|
|
|
- 'config/additional_environment.rb'
|
|
|
|
|
|
2022-01-03 02:23:27 +00:00
|
|
|
Style/GlobalStdStream:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-06-19 00:49:28 +00:00
|
|
|
Style/HashSyntax:
|
|
|
|
|
EnforcedStyle: no_mixed_keys
|
2024-08-21 00:58:24 +00:00
|
|
|
EnforcedShorthandSyntax: either
|
2019-10-15 17:25:53 +00:00
|
|
|
|
2023-12-20 08:13:48 +00:00
|
|
|
Style/HashEachMethods:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'db/migrate/072_add_enumerations_position.rb'
|
|
|
|
|
- 'db/migrate/078_add_custom_fields_position.rb'
|
|
|
|
|
|
2019-10-15 17:25:53 +00:00
|
|
|
Style/IdenticalConditionalBranches:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'config/initializers/10-patches.rb'
|
|
|
|
|
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
2019-10-16 13:00:29 +00:00
|
|
|
|
2023-10-16 14:56:35 +00:00
|
|
|
Style/InverseMethods:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2025-02-09 05:43:11 +00:00
|
|
|
Style/MultipleComparison:
|
|
|
|
|
Enabled: true
|
|
|
|
|
ComparisonsThreshold: 3
|
|
|
|
|
|
2020-12-06 00:31:36 +00:00
|
|
|
Style/NegatedIfElseCondition:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2024-06-06 00:53:06 +00:00
|
|
|
Style/NumericPredicate:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2024-07-06 08:04:22 +00:00
|
|
|
Style/PerlBackrefs:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2020-10-23 00:47:03 +00:00
|
|
|
Style/RaiseArgs:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2025-04-11 09:39:39 +00:00
|
|
|
Style/RedundantCondition:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-12-23 02:23:23 +00:00
|
|
|
Style/RedundantConstantBase:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'config/environments/production.rb'
|
|
|
|
|
|
2023-12-20 07:12:49 +00:00
|
|
|
Style/RedundantParentheses:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-09-19 05:46:24 +00:00
|
|
|
Style/Semicolon:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-05-27 22:26:48 +00:00
|
|
|
Style/SlicingWithRange:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-09-27 09:11:10 +00:00
|
|
|
Style/SoleNestedConditional:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2023-08-09 23:42:42 +00:00
|
|
|
Style/StringLiteralsInInterpolation:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2022-09-03 06:23:18 +00:00
|
|
|
Style/TernaryParentheses:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2019-10-16 13:00:29 +00:00
|
|
|
Style/TrailingCommaInArrayLiteral:
|
|
|
|
|
Enabled: false
|
2019-11-20 17:12:40 +00:00
|
|
|
|
|
|
|
|
Style/TrailingCommaInHashLiteral:
|
|
|
|
|
Enabled: false
|
2023-01-02 06:32:18 +00:00
|
|
|
|
|
|
|
|
Style/YodaExpression:
|
|
|
|
|
Enabled: false
|