From 94c96f3a0071fc00df3456d2e24459aace9c3272 Mon Sep 17 00:00:00 2001 From: Siddharth Asthana Date: Wed, 3 Aug 2022 23:14:14 +0530 Subject: [PATCH 1/2] RuboCop: Enable previously disabled Style/HashAsLastArrayItem Changelog: other --- .rubocop_todo/style/hash_as_last_array_item.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.rubocop_todo/style/hash_as_last_array_item.yml b/.rubocop_todo/style/hash_as_last_array_item.yml index eec2e77eafd21b..384d2dc5fced45 100644 --- a/.rubocop_todo/style/hash_as_last_array_item.yml +++ b/.rubocop_todo/style/hash_as_last_array_item.yml @@ -1,15 +1,11 @@ --- # Cop supports --auto-correct. Style/HashAsLastArrayItem: - # Offense count: 79 - # Temporarily disabled due to too many offenses - Enabled: false Exclude: - 'app/controllers/admin/application_settings_controller.rb' - 'app/controllers/admin/groups_controller.rb' - 'app/controllers/admin/users_controller.rb' - 'app/controllers/boards/issues_controller.rb' - - 'app/controllers/clusters/clusters_controller.rb' - 'app/controllers/concerns/issuable_actions.rb' - 'app/controllers/concerns/issuable_collections.rb' - 'app/controllers/profiles_controller.rb' @@ -29,6 +25,7 @@ Style/HashAsLastArrayItem: - 'app/models/customer_relations/contact.rb' - 'app/models/customer_relations/organization.rb' - 'app/models/deploy_key.rb' + - 'app/models/deployment.rb' - 'app/models/issue.rb' - 'app/models/merge_request.rb' - 'app/models/milestone.rb' @@ -59,4 +56,5 @@ Style/HashAsLastArrayItem: - 'spec/services/git/branch_hooks_service_spec.rb' - 'spec/services/metrics/dashboard/panel_preview_service_spec.rb' - 'spec/support/helpers/rack_attack_spec_helpers.rb' + - 'spec/workers/concerns/worker_attributes_spec.rb' - 'spec/workers/merge_worker_spec.rb' -- GitLab From 1d29d3d7a4100c434a2777022019a3e633232d16 Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Wed, 10 Aug 2022 11:27:01 +0200 Subject: [PATCH 2/2] Fix RuboCop offenses for Style/HashAsLastArrayItem in HAML --- app/views/import/_githubish_status.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/import/_githubish_status.html.haml b/app/views/import/_githubish_status.html.haml index 08f7cd57732130..35fd5d6eda678f 100644 --- a/app/views/import/_githubish_status.html.haml +++ b/app/views/import/_githubish_status.html.haml @@ -13,9 +13,9 @@ can_select_namespace: current_user.can_select_namespace?.to_s, ci_cd_only: has_ci_cd_only_params?.to_s, namespaces_path: import_available_namespaces_path, - repos_path: url_for([:status, :import, provider, format: :json]), - jobs_path: url_for([:realtime_changes, :import, provider, format: :json]), + repos_path: url_for([:status, :import, provider, { format: :json }]), + jobs_path: url_for([:realtime_changes, :import, provider, { format: :json }]), default_target_namespace: default_namespace_path, - import_path: url_for([:import, provider, format: :json]), + import_path: url_for([:import, provider, { format: :json }]), filterable: filterable.to_s, paginatable: paginatable.to_s }.merge(extra_data) } -- GitLab