Project

General

Profile

Patch #32530 » update-rubocop.patch

Go MAEDA, 2020-10-20 17:57

View differences:

.rubocop.yml
inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.3
TargetRubyVersion: 2.4
TargetRailsVersion: 5.2
NewCops: enable
Exclude:
- '**/vendor/**/*'
- '**/tmp/**/*'
......
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: false
Layout/SpaceBeforeBlockBraces:
# "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
# You can see results by "rubocop --only Layout/SpaceInsideBlockBraces"
Layout/SpaceInsideBlockBraces:
EnforcedStyle: no_space
SpaceBeforeBlockParameters: false
Enabled: false
# You can see results by "rubocop --only Layout/SpaceInsideHashLiteralBraces"
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Enabled: false
Lint/RaiseException:
Enabled: true
......
Style/TrailingCommaInHashLiteral:
Enabled: false
Style/RaiseArgs:
Enabled: false
.rubocop_todo.yml
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 20 --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 0.81.0.
# using RuboCop version 0.93.1.
# 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
......
- 'test/integration/api_test/projects_test.rb'
- 'test/integration/api_test/wiki_pages_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, Severity.
# SupportedStylesAlignWith: start_of_line, begin
Layout/BeginEndAlignment:
Exclude:
- 'lib/redmine/scm/adapters/mercurial_adapter.rb'
# Cop supports --auto-correct.
Layout/ClosingParenthesisIndentation:
Enabled: false
Exclude:
- 'app/helpers/issues_helper.rb'
- 'app/models/repository/cvs.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
- 'test/functional/repositories_cvs_controller_test.rb'
- 'test/helpers/activities_helper_test.rb'
- 'test/integration/repositories_git_test.rb'
- 'test/unit/mail_handler_test.rb'
- 'test/unit/query_test.rb'
- 'test/unit/repository_git_test.rb'
- 'test/unit/repository_mercurial_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
......
Exclude:
- 'config/routes.rb'
- 'db/migrate/001_setup.rb'
- 'lib/redmine/sudo_mode.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
......
Exclude:
- 'config/initializers/10-patches.rb'
# Cop supports --auto-correct.
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
# AllowedMethods: alias_method, public, protected, private
Layout/EmptyLinesAroundAttributeAccessor:
Exclude:
- 'app/models/issue.rb'
- 'app/models/query.rb'
- 'lib/redmine/scm/adapters/abstract_adapter.rb'
- 'lib/redmine/sudo_mode.rb'
- 'test/unit/lib/redmine/safe_attributes_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
......
- 'db/migrate/20131215104612_store_relation_type_in_journal_details.rb'
- 'db/migrate/20180923082945_change_sqlite_booleans_to_0_and_1.rb'
- 'lib/redmine/notifiable.rb'
- 'lib/redmine/scm/adapters/bazaar_adapter.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb'
- 'lib/redmine/wiki_formatting/html_parser.rb'
......
- 'test/integration/lib/redmine/themes_test.rb'
- 'test/integration/routing/activities_test.rb'
- 'test/integration/routing/repositories_test.rb'
- 'test/unit/lib/redmine/ciphering_test.rb'
- 'test/unit/lib/redmine/field_format/link_format_test.rb'
# Cop supports --auto-correct.
......
# Cop supports --auto-correct.
# Configuration parameters: Width, IgnoredPatterns.
Layout/IndentationWidth:
Enabled: false
Exclude:
- 'app/models/attachment.rb'
- 'app/models/journal.rb'
- 'db/migrate/20110902000000_create_changeset_parents.rb'
- 'db/migrate/20111201201315_add_unique_index_to_issue_relations.rb'
- 'db/migrate/20120115143126_set_default_repositories.rb'
- 'lib/redmine/export/pdf/issues_pdf_helper.rb'
- 'lib/redmine/scm/adapters/abstract_adapter.rb'
- 'lib/redmine/scm/adapters/git_adapter.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
- 'test/functional/trackers_controller_test.rb'
- 'test/helpers/application_helper_test.rb'
- 'test/helpers/avatars_helper_test.rb'
- 'test/integration/api_test/issues_test.rb'
- 'test/mocks/open_id_authentication_mock.rb'
- 'test/unit/lib/redmine/menu_manager/menu_helper_test.rb'
- 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb'
- 'test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb'
- 'test/unit/mail_handler_test.rb'
- 'test/unit/repository_git_test.rb'
- 'test/unit/repository_mercurial_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
......
- 'test/functional/documents_controller_test.rb'
- 'test/functional/imports_controller_test.rb'
- 'test/functional/issues_controller_transaction_test.rb'
- 'test/functional/my_controller_test.rb'
- 'test/functional/queries_controller_test.rb'
- 'test/functional/timelog_controller_test.rb'
- 'test/helpers/application_helper_test.rb'
......
Layout/RescueEnsureAlignment:
Exclude:
- 'db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb'
- 'lib/redmine/scm/adapters/mercurial_adapter.rb'
# Cop supports --auto-correct.
Layout/SpaceAfterComma:
......
- 'test/unit/role_test.rb'
- 'test/unit/user_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
# SupportedStylesForExponentOperator: space, no_space
......
- 'test/unit/mailer_test.rb'
- 'test/unit/search_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideBlockBraces:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
......
- 'app/helpers/issues_helper.rb'
- 'app/models/auth_source_ldap.rb'
- 'app/models/repository/cvs.rb'
- 'lib/redmine/scm/adapters/abstract_adapter.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/git_adapter.rb'
- 'lib/redmine/sudo_mode.rb'
- 'lib/redmine/wiki_formatting/textile/formatter.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
......
Lint/AmbiguousBlockAssociation:
Enabled: false
# Cop supports --auto-correct.
Lint/AmbiguousOperator:
Exclude:
- 'app/controllers/application_controller.rb'
......
- 'test/unit/custom_field_test.rb'
- 'test/unit/member_test.rb'
# Cop supports --auto-correct.
Lint/AmbiguousRegexpLiteral:
Enabled: false
......
- 'test/unit/attachment_test.rb'
- 'test/unit/issue_import_test.rb'
Lint/EmptyWhen:
Lint/FloatComparison:
Exclude:
- 'app/controllers/issues_controller.rb'
- 'app/controllers/wiki_controller.rb'
- 'app/models/time_entry.rb'
- 'test/system/timelog_test.rb'
# Cop supports --auto-correct.
Lint/InterpolationCheck:
Exclude:
- 'app/models/user.rb'
# Cop supports --auto-correct.
Lint/Loop:
Exclude:
- 'lib/redmine/helpers/gantt.rb'
Lint/MissingSuper:
Exclude:
- 'app/models/query.rb'
- 'lib/redmine/scm/adapters/bazaar_adapter.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb'
- 'lib/redmine/syntax_highlighting.rb'
- 'lib/redmine/twofa/base.rb'
- 'lib/redmine/unified_diff.rb'
- 'lib/redmine/views/builders/structure.rb'
- 'lib/redmine/wiki_formatting/html_parser.rb'
Lint/MixedRegexpCaptureTypes:
Exclude:
- 'app/helpers/application_helper.rb'
# Cop supports --auto-correct.
Lint/NonDeterministicRequireOrder:
Exclude:
- 'lib/redmine/core_ext.rb'
# Cop supports --auto-correct.
Lint/ParenthesesAsGroupedExpression:
Exclude:
- 'test/functional/my_controller_test.rb'
......
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/subversion_adapter.rb'
# Cop supports --auto-correct.
Lint/UnifiedInteger:
Exclude:
- 'test/unit/query_test.rb'
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
......
Lint/UnusedMethodArgument:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
Lint/UselessAccessModifier:
Exclude:
- 'test/functional/repositories_git_controller_test.rb'
Lint/UselessAssignment:
Enabled: false
......
- 'app/models/time_entry_activity.rb'
- 'lib/redmine/helpers/gantt.rb'
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
Exclude:
......
- 'test/helpers/application_helper_test.rb'
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Enabled: false
......
- 'test/unit/issue_import_test.rb'
- 'test/unit/time_entry_import_test.rb'
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'app/models/issue_import.rb'
- 'app/models/setting.rb'
- 'db/migrate/20120422150750_change_repositories_to_full_sti.rb'
- 'db/migrate/20180923082945_change_sqlite_booleans_to_0_and_1.rb'
- 'db/migrate/20180923091603_change_sqlite_booleans_default.rb'
- 'lib/redmine/scm/adapters/bazaar_adapter.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
# Cop supports --auto-correct.
Performance/StringReplacement:
Exclude:
......
# Include: app/models/**/*.rb
Rails/FindBy:
Exclude:
- 'app/models/attachment.rb'
- 'app/models/enumeration.rb'
- 'app/models/issue_import.rb'
- 'app/models/repository.rb'
......
- 'app/models/setting.rb'
- 'lib/redmine/configuration.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: separated, grouped
Style/AccessorGrouping:
Exclude:
- 'app/models/user.rb'
- 'lib/redmine/helpers/gantt.rb'
- 'lib/redmine/unified_diff.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: prefer_alias, prefer_alias_method
......
Style/AndOr:
Exclude:
- 'app/controllers/account_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/calendars_controller.rb'
- 'app/helpers/repositories_helper.rb'
- 'app/models/query.rb'
......
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
Style/CaseLikeIf:
Exclude:
- 'app/controllers/wiki_controller.rb'
- 'app/helpers/members_helper.rb'
- 'app/models/issue_query.rb'
- 'app/models/journal.rb'
- 'app/models/repository/cvs.rb'
- 'app/models/setting.rb'
- 'app/models/time_entry.rb'
- 'app/models/user.rb'
- 'app/models/workflow_transition.rb'
- 'lib/redmine/access_control.rb'
- 'lib/redmine/export/pdf/issues_pdf_helper.rb'
- 'lib/redmine/field_format.rb'
- 'lib/redmine/i18n.rb'
- 'lib/redmine/plugin.rb'
- 'lib/redmine/scm/adapters/bazaar_adapter.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/git_adapter.rb'
- 'lib/redmine/unified_diff.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: ==, equal?, eql?
Style/ClassEqualityComparison:
Exclude:
- 'app/models/principal.rb'
# Cop supports --auto-correct.
Style/ClassMethods:
Exclude:
......
- 'test/unit/default_data_test.rb'
- 'test/unit/lib/redmine/export/pdf_test.rb'
Style/CombinableLoops:
Exclude:
- 'app/models/wiki_page.rb'
- 'lib/redmine/default_data/loader.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
......
Style/Documentation:
Enabled: false
# Configuration parameters: EnforcedStyle.
# SupportedStyles: allowed_in_returns, forbidden
Style/DoubleNegation:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/helpers/application_helper.rb'
- 'app/models/attachment.rb'
- 'app/models/issue_import.rb'
- 'app/models/mailer.rb'
- 'app/models/query.rb'
......
Style/ExpandPathArguments:
Enabled: false
# Cop supports --auto-correct.
Style/ExplicitBlockArgument:
Exclude:
- 'app/models/board.rb'
- 'lib/redmine/activity/fetcher.rb'
- 'lib/redmine/menu_manager.rb'
- 'lib/redmine/plugin.rb'
- 'lib/redmine/scm/adapters/subversion_adapter.rb'
- 'test/test_helper.rb'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: format, sprintf, percent
......
Style/GuardClause:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces
Style/HashAsLastArrayItem:
Exclude:
- 'app/controllers/enumerations_controller.rb'
- 'app/models/board.rb'
# Cop supports --auto-correct.
Style/HashEachMethods:
Exclude:
......
Style/IfUnlessModifier:
Enabled: false
# Cop supports --auto-correct.
Style/IfUnlessModifierOfIfUnless:
Exclude:
- 'app/models/attachment.rb'
......
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb'
Style/MethodMissingSuper:
Exclude:
- 'lib/redmine/views/builders/structure.rb'
Style/MissingRespondToMissing:
Exclude:
- 'lib/redmine/views/builders/structure.rb'
......
- 'lib/redmine/wiki_formatting.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
# Cop supports --auto-correct.
Style/MultilineTernaryOperator:
Exclude:
- 'lib/redmine/ciphering.rb'
......
Exclude:
- 'lib/redmine/views/labelled_form_builder.rb'
# Cop supports --auto-correct.
Style/NestedTernaryOperator:
Exclude:
- 'app/helpers/queries_helper.rb'
......
MinDigits: 9
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# Configuration parameters: EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Enabled: false
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Enabled: false
# Cop supports --auto-correct.
Style/OrAssignment:
Exclude:
......
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Style/RedundantAssignment:
Exclude:
- 'app/models/auth_source_ldap.rb'
- 'app/models/issue_query.rb'
- 'app/models/mailer.rb'
- 'app/models/mail_handler.rb'
- 'app/models/query.rb'
- 'app/models/tracker.rb'
- 'app/models/user.rb'
- 'app/models/workflow_rule.rb'
- 'lib/redmine/access_control.rb'
- 'lib/redmine/default_data/loader.rb'
- 'lib/redmine/plugin.rb'
- 'lib/redmine/scm/adapters/abstract_adapter.rb'
- 'lib/redmine/scm/adapters/bazaar_adapter.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb'
- 'lib/redmine/sort_criteria.rb'
- 'lib/redmine/wiki_formatting.rb'
- 'lib/redmine/wiki_formatting/markdown/formatter.rb'
# Cop supports --auto-correct.
Style/RedundantCapitalW:
Exclude:
- 'test/unit/query_test.rb'
# Cop supports --auto-correct.
Style/RedundantCondition:
......
- 'app/controllers/search_controller.rb'
- 'app/models/enumeration.rb'
- 'app/models/principal.rb'
- 'app/models/query.rb'
- 'app/models/repository/cvs.rb'
- 'app/models/version.rb'
- 'lib/redmine/field_format.rb'
- 'lib/redmine/platform.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/filesystem_adapter.rb'
- 'test/unit/attachment_test.rb'
- 'test/unit/lib/redmine/export/pdf_test.rb'
- 'test/unit/project_test.rb'
- 'test/unit/user_test.rb'
- 'test/unit/version_test.rb'
# Cop supports --auto-correct.
Style/RedundantRegexpCharacterClass:
Exclude:
- 'app/helpers/application_helper.rb'
# Cop supports --auto-correct.
Style/RedundantRegexpEscape:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
......
Style/RedundantSelf:
Enabled: false
# Cop supports --auto-correct.
Style/RedundantSelfAssignment:
Exclude:
- 'lib/redmine/menu_manager.rb'
# Cop supports --auto-correct.
Style/RedundantSort:
Exclude:
......
- 'app/models/issue_query.rb'
- 'app/models/journal.rb'
- 'app/models/mail_handler.rb'
- 'app/models/project.rb'
- 'app/models/query.rb'
- 'app/models/tracker.rb'
- 'lib/redmine/configuration.rb'
- 'lib/redmine/i18n.rb'
- 'lib/redmine/scm/adapters/git_adapter.rb'
......
Style/SingleLineMethods:
Enabled: false
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/controllers/journals_controller.rb'
- 'app/controllers/repositories_controller.rb'
- 'app/controllers/wiki_controller.rb'
- 'app/models/board.rb'
- 'app/models/changeset.rb'
- 'app/models/issue.rb'
- 'app/models/issue_import.rb'
- 'app/models/issue_relation.rb'
- 'app/models/mail_handler.rb'
- 'app/models/principal.rb'
- 'app/models/project.rb'
- 'app/models/query.rb'
- 'app/models/time_entry.rb'
- 'app/models/token.rb'
- 'app/models/user_import.rb'
- 'app/models/version.rb'
- 'app/models/watcher.rb'
- 'app/models/wiki_page.rb'
- 'lib/redmine/core_ext/active_record.rb'
# Cop supports --auto-correct.
# Configuration parameters: .
# SupportedStyles: use_perl_names, use_english_names
......
- 'config/environment.rb'
- 'config/initializers/10-patches.rb'
# Cop supports --auto-correct.
Style/StringConcatenation:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
......
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
- 'test/unit/member_test.rb'
# Cop supports --auto-correct.
Style/StructInheritance:
Exclude:
- 'lib/redmine/notifiable.rb'
Gemfile
gem 'capybara', '~> 3.31.0'
gem "selenium-webdriver"
# RuboCop
gem 'rubocop', '~> 0.81.0'
gem 'rubocop', '~> 0.93.0'
gem 'rubocop-performance', '~> 1.5.0'
gem 'rubocop-rails', '~> 2.5.0'
end
(3-3/3)