Commit 7d903519 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rc/enable_rails_cops' into 'master'

Enable Rails rubocops

See merge request gitlab-org/gitlab!23101
parents 9d154542 c9a865ac
...@@ -301,24 +301,6 @@ RSpec/AnyInstanceOf: ...@@ -301,24 +301,6 @@ RSpec/AnyInstanceOf:
Enabled: false Enabled: false
# Cops for upgrade to gitlab-styles 3.1.0 # Cops for upgrade to gitlab-styles 3.1.0
Rails/SafeNavigationWithBlank:
Enabled: false
Rails/ApplicationController:
Enabled: false
Rails/ApplicationMailer:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
Rails/HelperInstanceVariable:
Enabled: false
Rails/EnumHash:
Enabled: false
RSpec/ReceiveCounts: RSpec/ReceiveCounts:
Enabled: false Enabled: false
...@@ -369,3 +351,4 @@ Style/MultilineWhenThen: ...@@ -369,3 +351,4 @@ Style/MultilineWhenThen:
Style/FloatDivision: Style/FloatDivision:
Enabled: false Enabled: false
\ No newline at end of file
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `rubocop --auto-gen-config`
# on 2019-05-04 16:01:00 +0000 using RuboCop version 0.68.1. # on 2020-01-16 11:53:06 -0800 using RuboCop version 0.74.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # versions of RuboCop, may require this file to be generated again.
# Offense count: 264 # Offense count: 299
# Cop supports --auto-correct.
Capybara/CurrentPathExpectation: Capybara/CurrentPathExpectation:
Enabled: false Enabled: false
# Offense count: 1097 # Offense count: 1432
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_argument, with_fixed_indentation # SupportedStyles: with_first_argument, with_fixed_indentation
Layout/AlignArguments: Layout/AlignArguments:
Enabled: false Enabled: false
# Offense count: 824 # Offense count: 1630
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table # SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table # SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
...@@ -32,39 +33,32 @@ Layout/ClosingHeredocIndentation: ...@@ -32,39 +33,32 @@ Layout/ClosingHeredocIndentation:
Exclude: Exclude:
- 'app/graphql/mutations/merge_requests/set_wip.rb' - 'app/graphql/mutations/merge_requests/set_wip.rb'
- 'ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb' - 'ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb'
- 'ee/db/migrate/20160204190809_update_jenkins_service_category.rb'
- 'ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb'
- 'ee/lib/gitlab/geo/health_check.rb' - 'ee/lib/gitlab/geo/health_check.rb'
- 'lib/gitlab/background_migration/populate_untracked_uploads.rb' - 'lib/gitlab/background_migration/populate_untracked_uploads.rb'
- 'qa/qa/service/kubernetes_cluster.rb'
- 'spec/features/merge_request/user_sees_diff_spec.rb' - 'spec/features/merge_request/user_sees_diff_spec.rb'
- 'spec/lib/gitlab/asciidoc_spec.rb' - 'spec/lib/gitlab/asciidoc_spec.rb'
- 'spec/lib/gitlab/checks/project_moved_spec.rb' - 'spec/lib/gitlab/checks/project_moved_spec.rb'
- 'spec/rubocop/cop/active_record_association_reload_spec.rb' - 'spec/rubocop/cop/active_record_association_reload_spec.rb'
- 'spec/services/task_list_toggle_service_spec.rb' - 'spec/services/task_list_toggle_service_spec.rb'
# Offense count: 14 # Offense count: 9
# Cop supports --auto-correct. # Cop supports --auto-correct.
Layout/ClosingParenthesisIndentation: Layout/ClosingParenthesisIndentation:
Exclude: Exclude:
- 'db/post_migrate/20180704145007_update_project_indexes.rb' - 'db/post_migrate/20180704145007_update_project_indexes.rb'
- 'ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb' - 'ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb'
- 'ee/db/migrate/20180308234102_add_partial_index_to_project_repository_states_checksum_columns.rb'
- 'ee/db/post_migrate/20180605213516_fix_partial_index_to_project_repository_states_checksum_columns.rb'
- 'ee/lib/ee/gitlab/usage_data.rb'
- 'spec/services/issues/resolve_discussions_spec.rb' - 'spec/services/issues/resolve_discussions_spec.rb'
- 'spec/services/projects/update_service_spec.rb' - 'spec/services/projects/update_service_spec.rb'
- 'spec/support/helpers/stub_object_storage.rb' - 'spec/support/helpers/stub_object_storage.rb'
- 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb' - 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb'
# Offense count: 2 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing # SupportedStyles: leading, trailing
Layout/DotPosition: Layout/DotPosition:
Exclude: Exclude:
- 'app/models/concerns/relative_positioning.rb' - 'app/models/concerns/relative_positioning.rb'
- 'app/models/group.rb'
# Offense count: 69 # Offense count: 69
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -81,74 +75,67 @@ Layout/EmptyLinesAroundArguments: ...@@ -81,74 +75,67 @@ Layout/EmptyLinesAroundArguments:
- 'lib/banzai/pipeline/single_line_pipeline.rb' - 'lib/banzai/pipeline/single_line_pipeline.rb'
- 'spec/features/markdown/copy_as_gfm_spec.rb' - 'spec/features/markdown/copy_as_gfm_spec.rb'
# Offense count: 160 # Offense count: 305
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets # SupportedStyles: special_inside_parentheses, consistent, align_brackets
Layout/IndentFirstArrayElement: Layout/IndentFirstArrayElement:
Enabled: false Enabled: false
# Offense count: 631 # Offense count: 1005
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces # SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentFirstHashElement: Layout/IndentFirstHashElement:
Enabled: false Enabled: false
# Offense count: 5 # Offense count: 4
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: consistent, align_parentheses # SupportedStyles: consistent, align_parentheses
Layout/IndentFirstParameter: Layout/IndentFirstParameter:
Exclude: Exclude:
- 'app/models/ci/pipeline_schedule.rb'
- 'lib/gitlab/cross_project_access.rb' - 'lib/gitlab/cross_project_access.rb'
- 'lib/gitlab/data_builder/push.rb' - 'lib/gitlab/data_builder/push.rb'
- 'spec/support/helpers/repo_helpers.rb' - 'spec/support/helpers/repo_helpers.rb'
- 'spec/support/helpers/stub_object_storage.rb' - 'spec/support/helpers/stub_object_storage.rb'
# Offense count: 5 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
Layout/LeadingBlankLines: Layout/LeadingBlankLines:
Exclude: Exclude:
- 'app/workers/update_project_statistics_worker.rb'
- 'db/migrate/20161007073613_create_user_activities.rb'
- 'ee/spec/helpers/boards_helper_spec.rb'
- 'lib/tasks/yarn.rake' - 'lib/tasks/yarn.rake'
- 'spec/javascripts/fixtures/merge_requests_diffs.rb'
# Offense count: 30 # Offense count: 54
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented # SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation: Layout/MultilineOperationIndentation:
Enabled: false Enabled: false
# Offense count: 13 # Offense count: 10
# Cop supports --auto-correct. # Cop supports --auto-correct.
Layout/RescueEnsureAlignment: Layout/RescueEnsureAlignment:
Exclude: Exclude:
- 'app/models/blob_viewer/dependency_manager.rb' - 'app/models/blob_viewer/dependency_manager.rb'
- 'app/models/ci/pipeline.rb'
- 'app/models/project.rb' - 'app/models/project.rb'
- 'app/services/prometheus/proxy_service.rb' - 'app/services/prometheus/proxy_service.rb'
- 'app/workers/delete_stored_files_worker.rb' - 'app/workers/delete_stored_files_worker.rb'
- 'app/workers/reactive_caching_worker.rb' - 'app/workers/reactive_caching_worker.rb'
- 'config/initializers/1_settings.rb' - 'config/initializers/1_settings.rb'
- 'config/initializers/trusted_proxies.rb' - 'config/initializers/trusted_proxies.rb'
- 'ee/db/migrate/20151113115819_canonicalize_kerberos_identities.rb'
- 'lib/gitlab/background_migration/archive_legacy_traces.rb' - 'lib/gitlab/background_migration/archive_legacy_traces.rb'
- 'lib/gitlab/highlight.rb' - 'lib/gitlab/highlight.rb'
- 'lib/tasks/gitlab/lfs/migrate.rake' - 'lib/tasks/gitlab/lfs/migrate.rake'
# Offense count: 344 # Offense count: 522
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: require_no_space, require_space # SupportedStyles: require_no_space, require_space
Layout/SpaceInLambdaLiteral: Layout/SpaceInLambdaLiteral:
Enabled: false Enabled: false
# Offense count: 583 # Offense count: 796
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space # SupportedStyles: space, no_space
...@@ -156,7 +143,7 @@ Layout/SpaceInLambdaLiteral: ...@@ -156,7 +143,7 @@ Layout/SpaceInLambdaLiteral:
Layout/SpaceInsideBlockBraces: Layout/SpaceInsideBlockBraces:
Enabled: false Enabled: false
# Offense count: 255 # Offense count: 315
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space # SupportedStyles: space, no_space
...@@ -185,13 +172,13 @@ Lint/DuplicateMethods: ...@@ -185,13 +172,13 @@ Lint/DuplicateMethods:
- 'lib/gitlab/git/tree.rb' - 'lib/gitlab/git/tree.rb'
- 'lib/gitlab/git/wiki_page.rb' - 'lib/gitlab/git/wiki_page.rb'
# Offense count: 2 # Offense count: 3
Lint/InterpolationCheck: Lint/InterpolationCheck:
Exclude: Exclude:
- 'spec/features/issues/filtered_search/filter_issues_spec.rb' - 'spec/features/issues/filtered_search/filter_issues_spec.rb'
- 'spec/services/quick_actions/interpret_service_spec.rb' - 'spec/services/quick_actions/interpret_service_spec.rb'
# Offense count: 326 # Offense count: 122
# Configuration parameters: MaximumRangeSize. # Configuration parameters: MaximumRangeSize.
Lint/MissingCopEnableDirective: Lint/MissingCopEnableDirective:
Enabled: false Enabled: false
...@@ -211,14 +198,13 @@ Lint/ToJSON: ...@@ -211,14 +198,13 @@ Lint/ToJSON:
- 'lib/gitlab/cycle_analytics/usage_data.rb' - 'lib/gitlab/cycle_analytics/usage_data.rb'
- 'lib/gitlab/template/base_template.rb' - 'lib/gitlab/template/base_template.rb'
# Offense count: 7 # Offense count: 6
Lint/UriEscapeUnescape: Lint/UriEscapeUnescape:
Exclude: Exclude:
- 'app/controllers/application_controller.rb' - 'app/controllers/application_controller.rb'
- 'app/models/project_services/drone_ci_service.rb' - 'app/models/project_services/drone_ci_service.rb'
- 'spec/lib/google_api/auth_spec.rb' - 'spec/lib/google_api/auth_spec.rb'
- 'spec/requests/api/files_spec.rb' - 'spec/requests/api/files_spec.rb'
- 'spec/requests/api/internal/base_spec.rb'
# Offense count: 1 # Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects. # Configuration parameters: CheckForMethodsWithNoSideEffects.
...@@ -226,14 +212,14 @@ Lint/Void: ...@@ -226,14 +212,14 @@ Lint/Void:
Exclude: Exclude:
- 'lib/gitlab/git/diff_collection.rb' - 'lib/gitlab/git/diff_collection.rb'
# Offense count: 158 # Offense count: 165
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https # URISchemes: http, https
Metrics/LineLength: Metrics/LineLength:
Max: 176 Max: 176
# Offense count: 94 # Offense count: 143
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms. # Configuration parameters: ExpectMatchingDefinition, 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 # 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: Naming/FileName:
...@@ -250,32 +236,32 @@ Naming/HeredocDelimiterCase: ...@@ -250,32 +236,32 @@ Naming/HeredocDelimiterCase:
- 'spec/support/helpers/repo_helpers.rb' - 'spec/support/helpers/repo_helpers.rb'
- 'spec/support/helpers/seed_repo.rb' - 'spec/support/helpers/seed_repo.rb'
# Offense count: 197 # Offense count: 211
# Configuration parameters: Blacklist. # Configuration parameters: Blacklist.
# Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) # Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming: Naming/HeredocDelimiterNaming:
Enabled: false Enabled: false
# Offense count: 125 # Offense count: 139
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: PreferredName. # Configuration parameters: PreferredName.
Naming/RescuedExceptionsVariableName: Naming/RescuedExceptionsVariableName:
Enabled: false Enabled: false
# Offense count: 7081 # Offense count: 9913
# Configuration parameters: Prefixes. # Configuration parameters: Prefixes.
# Prefixes: when, with, without # Prefixes: when, with, without
RSpec/ContextWording: RSpec/ContextWording:
Enabled: false Enabled: false
# Offense count: 719 # Offense count: 879
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: method_call, block # SupportedStyles: method_call, block
RSpec/ExpectChange: RSpec/ExpectChange:
Enabled: false Enabled: false
# Offense count: 512 # Offense count: 660
RSpec/ExpectInHook: RSpec/ExpectInHook:
Enabled: false Enabled: false
...@@ -317,40 +303,38 @@ RSpec/MultipleSubjects: ...@@ -317,40 +303,38 @@ RSpec/MultipleSubjects:
Exclude: Exclude:
- 'spec/services/merge_requests/create_from_issue_service_spec.rb' - 'spec/services/merge_requests/create_from_issue_service_spec.rb'
# Offense count: 4 # Offense count: 3
RSpec/OverwritingSetup: RSpec/OverwritingSetup:
Exclude: Exclude:
- 'spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb'
- 'spec/models/email_spec.rb' - 'spec/models/email_spec.rb'
- 'spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb' - 'spec/services/merge_requests/add_todo_when_build_fails_service_spec.rb'
- 'spec/services/notes/quick_actions_service_spec.rb' - 'spec/services/notes/quick_actions_service_spec.rb'
# Offense count: 1828 # Offense count: 2018
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: Strict, EnforcedStyle. # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
# SupportedStyles: inflected, explicit # SupportedStyles: inflected, explicit
RSpec/PredicateMatcher: RSpec/PredicateMatcher:
Enabled: false Enabled: false
# Offense count: 57 # Offense count: 69
RSpec/RepeatedExample: RSpec/RepeatedExample:
Enabled: false Enabled: false
# Offense count: 474 # Offense count: 584
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: and_return, block # SupportedStyles: and_return, block
RSpec/ReturnFromStub: RSpec/ReturnFromStub:
Enabled: false Enabled: false
# Offense count: 188 # Offense count: 380
RSpec/ScatteredLet: RSpec/ScatteredLet:
Enabled: false Enabled: false
# Offense count: 10 # Offense count: 8
RSpec/ScatteredSetup: RSpec/ScatteredSetup:
Exclude: Exclude:
- 'spec/controllers/projects/templates_controller_spec.rb'
- 'spec/lib/gitlab/bitbucket_import/importer_spec.rb' - 'spec/lib/gitlab/bitbucket_import/importer_spec.rb'
- 'spec/requests/api/jobs_spec.rb' - 'spec/requests/api/jobs_spec.rb'
- 'spec/services/projects/create_service_spec.rb' - 'spec/services/projects/create_service_spec.rb'
...@@ -369,6 +353,27 @@ RSpec/VoidExpect: ...@@ -369,6 +353,27 @@ RSpec/VoidExpect:
- 'spec/models/ci/runner_spec.rb' - 'spec/models/ci/runner_spec.rb'
- 'spec/services/users/destroy_service_spec.rb' - 'spec/services/users/destroy_service_spec.rb'
# Offense count: 10
# Cop supports --auto-correct.
Rails/ApplicationController:
Exclude:
- 'app/controllers/acme_challenges_controller.rb'
- 'app/controllers/chaos_controller.rb'
- 'app/controllers/health_controller.rb'
- 'app/controllers/metrics_controller.rb'
- 'ee/app/controllers/oauth/geo_auth_controller.rb'
- 'ee/spec/helpers/ee/services_helper_spec.rb'
- 'lib/gitlab/base_doorkeeper_controller.rb'
- 'lib/gitlab/request_forgery_protection.rb'
- 'spec/controllers/concerns/continue_params_spec.rb'
- 'spec/lib/marginalia_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/base_mailer.rb'
# Offense count: 8 # Offense count: 8
# Cop supports --auto-correct. # Cop supports --auto-correct.
Rails/BelongsTo: Rails/BelongsTo:
...@@ -378,39 +383,37 @@ Rails/BelongsTo: ...@@ -378,39 +383,37 @@ Rails/BelongsTo:
- 'ee/app/models/prometheus_alert.rb' - 'ee/app/models/prometheus_alert.rb'
- 'ee/app/models/prometheus_alert_event.rb' - 'ee/app/models/prometheus_alert_event.rb'
# Offense count: 80 # Offense count: 151
# Configuration parameters: Include. # Configuration parameters: Include.
# Include: db/migrate/*.rb # Include: db/migrate/*.rb
Rails/CreateTableWithTimestamps: Rails/CreateTableWithTimestamps:
Enabled: false Enabled: false
# Offense count: 222 # Offense count: 266
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments # SupportedStyles: slashes, arguments
Rails/FilePath: Rails/FilePath:
Enabled: false Enabled: false
# Offense count: 167 # Offense count: 211
# Configuration parameters: Include. # Configuration parameters: Include.
# Include: app/models/**/*.rb # Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent: Rails/HasManyOrHasOneDependent:
Enabled: false Enabled: false
# Offense count: 2 # Offense count: 431
# Configuration parameters: Include. # Configuration parameters: Include.
# Include: app/controllers/**/*.rb # Include: app/helpers/**/*.rb
Rails/IgnoredSkipActionFilterOption: Rails/HelperInstanceVariable:
Exclude: Enabled: false
- 'app/controllers/projects/snippets_controller.rb'
- 'app/controllers/snippets_controller.rb'
# Offense count: 87 # Offense count: 103
# Configuration parameters: Include. # Configuration parameters: Include.
# Include: app/models/**/*.rb # Include: app/models/**/*.rb
Rails/InverseOf: Rails/InverseOf:
Enabled: false Enabled: false
# Offense count: 46 # Offense count: 51
# Configuration parameters: Include. # Configuration parameters: Include.
# Include: app/controllers/**/*.rb # Include: app/controllers/**/*.rb
Rails/LexicallyScopedActionFilter: Rails/LexicallyScopedActionFilter:
...@@ -425,6 +428,12 @@ Rails/LinkToBlank: ...@@ -425,6 +428,12 @@ Rails/LinkToBlank:
- 'ee/app/helpers/ee/user_callouts_helper.rb' - 'ee/app/helpers/ee/user_callouts_helper.rb'
- 'ee/app/helpers/license_helper.rb' - 'ee/app/helpers/license_helper.rb'
# Offense count: 35
# Configuration parameters: Include.
# Include: **/Rakefile, **/*.rake
Rails/RakeEnvironment:
Enabled: false
# Offense count: 1 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: Include. # Configuration parameters: Include.
...@@ -433,31 +442,16 @@ Rails/RedundantAllowNil: ...@@ -433,31 +442,16 @@ Rails/RedundantAllowNil:
Exclude: Exclude:
- 'app/models/application_setting.rb' - 'app/models/application_setting.rb'
# Offense count: 2 # Offense count: 868
# Configuration parameters: Include.
# Include: db/migrate/*.rb
Rails/ReversibleMigration:
Exclude:
- 'db/migrate/20160824103857_drop_unused_ci_tables.rb'
# Offense count: 860
# Configuration parameters: Blacklist, Whitelist. # Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
Rails/SkipsModelValidations: Rails/SkipsModelValidations:
Enabled: false Enabled: false
# Offense count: 1 # Offense count: 8
# Configuration parameters: Environments.
# Environments: development, test, production
Rails/UnknownEnv:
Exclude:
- 'db/migrate/20171124125748_populate_missing_merge_request_statuses.rb'
# Offense count: 11
# Cop supports --auto-correct. # Cop supports --auto-correct.
Security/YAMLLoad: Security/YAMLLoad:
Exclude: Exclude:
- 'lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb'
- 'lib/gitlab/redis/wrapper.rb' - 'lib/gitlab/redis/wrapper.rb'
- 'lib/system_check/incoming_email/imap_authentication_check.rb' - 'lib/system_check/incoming_email/imap_authentication_check.rb'
- 'spec/config/mail_room_spec.rb' - 'spec/config/mail_room_spec.rb'
...@@ -470,7 +464,7 @@ Security/YAMLLoad: ...@@ -470,7 +464,7 @@ Security/YAMLLoad:
Style/AccessModifierDeclarations: Style/AccessModifierDeclarations:
Enabled: false Enabled: false
# Offense count: 121 # Offense count: 127
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: percent_q, bare_percent # SupportedStyles: percent_q, bare_percent
...@@ -489,19 +483,18 @@ Style/Dir: ...@@ -489,19 +483,18 @@ Style/Dir:
Exclude: Exclude:
- 'qa/qa.rb' - 'qa/qa.rb'
# Offense count: 7 # Offense count: 6
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/EachWithObject: Style/EachWithObject:
Exclude: Exclude:
- 'lib/expand_variables.rb' - 'lib/expand_variables.rb'
- 'lib/gitlab/ci/ansi2html.rb' - 'lib/gitlab/ci/ansi2html.rb'
- 'lib/gitlab/ee_compat_check.rb'
- 'lib/gitlab/hook_data/issuable_builder.rb' - 'lib/gitlab/hook_data/issuable_builder.rb'
- 'lib/gitlab/i18n/po_linter.rb' - 'lib/gitlab/i18n/po_linter.rb'
- 'lib/gitlab/import_export/members_mapper.rb' - 'lib/gitlab/import_export/members_mapper.rb'
- 'lib/gitlab/import_export/relation_factory.rb' - 'lib/gitlab/import_export/relation_factory.rb'
# Offense count: 34 # Offense count: 41
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: empty, nil, both # SupportedStyles: empty, nil, both
...@@ -515,7 +508,7 @@ Style/EmptyLambdaParameter: ...@@ -515,7 +508,7 @@ Style/EmptyLambdaParameter:
- 'app/models/ci/build.rb' - 'app/models/ci/build.rb'
- 'app/models/ci/runner.rb' - 'app/models/ci/runner.rb'
# Offense count: 9 # Offense count: 8
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/EmptyLiteral: Style/EmptyLiteral:
Exclude: Exclude:
...@@ -523,40 +516,40 @@ Style/EmptyLiteral: ...@@ -523,40 +516,40 @@ Style/EmptyLiteral:
- 'lib/gitlab/git/diff_collection.rb' - 'lib/gitlab/git/diff_collection.rb'
- 'lib/gitlab/gitaly_client.rb' - 'lib/gitlab/gitaly_client.rb'
- 'spec/helpers/merge_requests_helper_spec.rb' - 'spec/helpers/merge_requests_helper_spec.rb'
- 'spec/lib/gitlab/request_context_spec.rb'
- 'spec/lib/gitlab/workhorse_spec.rb' - 'spec/lib/gitlab/workhorse_spec.rb'
- 'spec/requests/api/jobs_spec.rb' - 'spec/requests/api/jobs_spec.rb'
- 'spec/support/shared_examples/chat_slash_commands_shared_examples.rb' - 'spec/support/shared_examples/chat_slash_commands_shared_examples.rb'
# Offense count: 180 # Offense count: 148
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, expanded # SupportedStyles: compact, expanded
Style/EmptyMethod: Style/EmptyMethod:
Enabled: false Enabled: false
# Offense count: 203 # Offense count: 346
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: format, sprintf, percent # SupportedStyles: format, sprintf, percent
Style/FormatString: Style/FormatString:
Enabled: false Enabled: false
# Offense count: 669 # Offense count: 692
# Configuration parameters: MinBodyLength. # Configuration parameters: MinBodyLength.
Style/GuardClause: Style/GuardClause:
Enabled: false Enabled: false
# Offense count: 27 # Offense count: 27
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse: Style/IfInsideElse:
Enabled: false Enabled: false
# Offense count: 1346 # Offense count: 1474
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/IfUnlessModifier: Style/IfUnlessModifier:
Enabled: false Enabled: false
# Offense count: 186 # Offense count: 314
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal # SupportedStyles: line_count_dependent, lambda, literal
...@@ -570,11 +563,11 @@ Style/LineEndConcatenation: ...@@ -570,11 +563,11 @@ Style/LineEndConcatenation:
- 'spec/lib/gitlab/gfm/reference_rewriter_spec.rb' - 'spec/lib/gitlab/gfm/reference_rewriter_spec.rb'
- 'spec/lib/gitlab/incoming_email_spec.rb' - 'spec/lib/gitlab/incoming_email_spec.rb'
# Offense count: 18 # Offense count: 17
Style/MethodMissingSuper: Style/MethodMissingSuper:
Enabled: false Enabled: false
# Offense count: 18 # Offense count: 17
Style/MissingRespondToMissing: Style/MissingRespondToMissing:
Enabled: false Enabled: false
...@@ -597,35 +590,28 @@ Style/MultilineIfModifier: ...@@ -597,35 +590,28 @@ Style/MultilineIfModifier:
- 'app/services/ci/process_pipeline_service.rb' - 'app/services/ci/process_pipeline_service.rb'
- 'lib/api/commit_statuses.rb' - 'lib/api/commit_statuses.rb'
# Offense count: 72 # Offense count: 34
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Enabled: false
# Offense count: 28
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: Whitelist. # Configuration parameters: Whitelist.
# Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with # Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
Style/NestedParenthesizedCalls: Style/NestedParenthesizedCalls:
Enabled: false Enabled: false
# Offense count: 31 # Offense count: 25
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinBodyLength. # Configuration parameters: EnforcedStyle, MinBodyLength.
# SupportedStyles: skip_modifier_ifs, always # SupportedStyles: skip_modifier_ifs, always
Style/Next: Style/Next:
Enabled: false Enabled: false
# Offense count: 67 # Offense count: 71
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedOctalStyle. # Configuration parameters: EnforcedOctalStyle.
# SupportedOctalStyles: zero_with_o, zero_only # SupportedOctalStyles: zero_with_o, zero_only
Style/NumericLiteralPrefix: Style/NumericLiteralPrefix:
Enabled: false Enabled: false
# Offense count: 186 # Offense count: 234
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison # SupportedStyles: predicate, comparison
...@@ -639,12 +625,12 @@ Style/OrAssignment: ...@@ -639,12 +625,12 @@ Style/OrAssignment:
- 'lib/api/commit_statuses.rb' - 'lib/api/commit_statuses.rb'
- 'lib/gitlab/project_transfer.rb' - 'lib/gitlab/project_transfer.rb'
# Offense count: 79 # Offense count: 106
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/ParallelAssignment: Style/ParallelAssignment:
Enabled: false Enabled: false
# Offense count: 1390 # Offense count: 1692
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters. # Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters: Style/PercentLiteralDelimiters:
...@@ -666,7 +652,7 @@ Style/PerlBackrefs: ...@@ -666,7 +652,7 @@ Style/PerlBackrefs:
- 'lib/gitlab/search_results.rb' - 'lib/gitlab/search_results.rb'
- 'lib/gitlab/sherlock/query.rb' - 'lib/gitlab/sherlock/query.rb'
# Offense count: 129 # Offense count: 165
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, exploded # SupportedStyles: compact, exploded
...@@ -687,7 +673,7 @@ Style/RedundantConditional: ...@@ -687,7 +673,7 @@ Style/RedundantConditional:
Exclude: Exclude:
- 'lib/system_check/helpers.rb' - 'lib/system_check/helpers.rb'
# Offense count: 360 # Offense count: 221
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/RedundantFreeze: Style/RedundantFreeze:
Enabled: false Enabled: false
...@@ -707,31 +693,31 @@ Style/RedundantReturn: ...@@ -707,31 +693,31 @@ Style/RedundantReturn:
- 'lib/gitlab/utils.rb' - 'lib/gitlab/utils.rb'
- 'lib/google_api/auth.rb' - 'lib/google_api/auth.rb'
# Offense count: 700 # Offense count: 739
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/RedundantSelf: Style/RedundantSelf:
Enabled: false Enabled: false
# Offense count: 28 # Offense count: 80
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes. # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed # SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral: Style/RegexpLiteral:
Enabled: false Enabled: false
# Offense count: 41 # Offense count: 42
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/RescueModifier: Style/RescueModifier:
Enabled: false Enabled: false
# Offense count: 197 # Offense count: 237
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit # SupportedStyles: implicit, explicit
Style/RescueStandardError: Style/RescueStandardError:
Enabled: false Enabled: false
# Offense count: 5 # Offense count: 4
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/SelfAssignment: Style/SelfAssignment:
Exclude: Exclude:
...@@ -746,7 +732,7 @@ Style/SingleLineMethods: ...@@ -746,7 +732,7 @@ Style/SingleLineMethods:
Exclude: Exclude:
- 'lib/gitlab/ci/ansi2html.rb' - 'lib/gitlab/ci/ansi2html.rb'
# Offense count: 91 # Offense count: 94
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: . # Configuration parameters: .
# SupportedStyles: use_perl_names, use_english_names # SupportedStyles: use_perl_names, use_english_names
...@@ -759,14 +745,14 @@ Style/StderrPuts: ...@@ -759,14 +745,14 @@ Style/StderrPuts:
Exclude: Exclude:
- 'config/initializers/rspec_profiling.rb' - 'config/initializers/rspec_profiling.rb'
# Offense count: 65 # Offense count: 75
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: single_quotes, double_quotes # SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation: Style/StringLiteralsInInterpolation:
Enabled: false Enabled: false
# Offense count: 187 # Offense count: 216
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods. # Configuration parameters: IgnoredMethods.
# IgnoredMethods: respond_to, define_method # IgnoredMethods: respond_to, define_method
...@@ -793,24 +779,22 @@ Style/TrailingCommaInArguments: ...@@ -793,24 +779,22 @@ Style/TrailingCommaInArguments:
Exclude: Exclude:
- 'spec/features/markdown/copy_as_gfm_spec.rb' - 'spec/features/markdown/copy_as_gfm_spec.rb'
# Offense count: 10 # Offense count: 2
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline. # Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma # SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral: Style/TrailingCommaInArrayLiteral:
Exclude: Exclude:
- 'ee/spec/models/project_spec.rb' - 'ee/spec/models/project_spec.rb'
- 'spec/lib/gitlab/diff/position_tracer_spec.rb'
- 'spec/lib/gitlab/metrics/dashboard/processor_spec.rb' - 'spec/lib/gitlab/metrics/dashboard/processor_spec.rb'
# Offense count: 2 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline. # Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma # SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral: Style/TrailingCommaInHashLiteral:
Exclude: Exclude:
- 'lib/gitlab/ci/ansi2html.rb' - 'lib/gitlab/ci/ansi2html.rb'
- 'lib/gitlab/kubernetes.rb'
# Offense count: 2 # Offense count: 2
# Cop supports --auto-correct. # Cop supports --auto-correct.
...@@ -819,7 +803,7 @@ Style/UnlessElse: ...@@ -819,7 +803,7 @@ Style/UnlessElse:
- 'lib/backup/manager.rb' - 'lib/backup/manager.rb'
- 'lib/gitlab/project_search_results.rb' - 'lib/gitlab/project_search_results.rb'
# Offense count: 10 # Offense count: 8
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/UnneededCondition: Style/UnneededCondition:
Exclude: Exclude:
...@@ -827,12 +811,10 @@ Style/UnneededCondition: ...@@ -827,12 +811,10 @@ Style/UnneededCondition:
- 'app/helpers/environment_helper.rb' - 'app/helpers/environment_helper.rb'
- 'app/models/project.rb' - 'app/models/project.rb'
- 'app/services/issuable/clone/base_service.rb' - 'app/services/issuable/clone/base_service.rb'
- 'app/services/prometheus/adapter_service.rb'
- 'lib/gitlab/email/message/repository_push.rb' - 'lib/gitlab/email/message/repository_push.rb'
- 'lib/gitlab/prometheus_client.rb'
- 'spec/lib/rspec_flaky/flaky_example_spec.rb' - 'spec/lib/rspec_flaky/flaky_example_spec.rb'
# Offense count: 73 # Offense count: 99
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/UnneededInterpolation: Style/UnneededInterpolation:
Enabled: false Enabled: false
......
...@@ -223,19 +223,19 @@ class User < ApplicationRecord ...@@ -223,19 +223,19 @@ class User < ApplicationRecord
after_initialize :set_projects_limit after_initialize :set_projects_limit
# User's Layout preference # User's Layout preference
enum layout: [:fixed, :fluid] enum layout: { fixed: 0, fluid: 1 }
# User's Dashboard preference # User's Dashboard preference
# Note: When adding an option, it MUST go on the end of the array. # Note: When adding an option, it MUST go on the end of the array.
enum dashboard: [:projects, :stars, :project_activity, :starred_project_activity, :groups, :todos, :issues, :merge_requests, :operations] enum dashboard: { projects: 0, stars: 1, project_activity: 2, starred_project_activity: 3, groups: 4, todos: 5, issues: 6, merge_requests: 7, operations: 8 }
# User's Project preference # User's Project preference
# Note: When adding an option, it MUST go on the end of the array. # Note: When adding an option, it MUST go on the end of the array.
enum project_view: [:readme, :activity, :files] enum project_view: { readme: 0, activity: 1, files: 2 }
# User's role # User's role
# Note: When adding an option, it MUST go on the end of the array. # Note: When adding an option, it MUST go on the end of the array.
enum role: [:software_developer, :development_team_lead, :devops_engineer, :systems_administrator, :security_analyst, :data_analyst, :product_manager, :product_designer, :other], _suffix: true enum role: { software_developer: 0, development_team_lead: 1, devops_engineer: 2, systems_administrator: 3, security_analyst: 4, data_analyst: 5, product_manager: 6, product_designer: 7, other: 8 }, _suffix: true
delegate :path, to: :namespace, allow_nil: true, prefix: true delegate :path, to: :namespace, allow_nil: true, prefix: true
delegate :notes_filter_for, to: :user_preference delegate :notes_filter_for, to: :user_preference
......
...@@ -105,7 +105,7 @@ module EE ...@@ -105,7 +105,7 @@ module EE
return unless group.allowed_email_domain.present? return unless group.allowed_email_domain.present?
return unless allowed_domain_params return unless allowed_domain_params
if allowed_domain_params[:domain]&.blank? if allowed_domain_params[:domain].blank?
allowed_domain_params[:_destroy] = 1 allowed_domain_params[:_destroy] = 1
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment