diff --git a/.rubocop_todo/layout/first_hash_element_indentation.yml b/.rubocop_todo/layout/first_hash_element_indentation.yml index 34446f2cb61c637817df85d13f1c853965a48476..2f20d2ec239ef1587face8933fafc0106421bf28 100644 --- a/.rubocop_todo/layout/first_hash_element_indentation.yml +++ b/.rubocop_todo/layout/first_hash_element_indentation.yml @@ -2,22 +2,6 @@ # Cop supports --autocorrect. Layout/FirstHashElementIndentation: Exclude: - - 'app/components/diffs/stats_component.rb' - - 'app/controllers/admin/ci/variables_controller.rb' - - 'app/controllers/admin/system_info_controller.rb' - - 'app/controllers/concerns/milestone_actions.rb' - - 'app/controllers/concerns/render_service_results.rb' - - 'app/controllers/concerns/sourcegraph_decorator.rb' - - 'app/controllers/profiles/two_factor_auths_controller.rb' - - 'app/controllers/projects/badges_controller.rb' - - 'app/controllers/repositories/lfs_locks_api_controller.rb' - - 'app/experiments/concerns/project_commit_count.rb' - - 'app/graphql/mutations/clusters/agent_tokens/create.rb' - - 'app/graphql/mutations/notes/create/diff_note.rb' - - 'app/graphql/mutations/notes/create/image_diff_note.rb' - - 'app/graphql/mutations/notes/create/note.rb' - - 'app/graphql/mutations/todos/restore_many.rb' - - 'app/graphql/resolvers/group_packages_resolver.rb' - 'app/helpers/avatars_helper.rb' - 'app/helpers/breadcrumbs_helper.rb' - 'app/helpers/broadcast_messages_helper.rb' diff --git a/app/components/diffs/stats_component.rb b/app/components/diffs/stats_component.rb index dc42a849ccf5cdb8fcb8c750e9ffd40d04b05c28..407c3ca4e587947d6eb71dd0c850193b89489509 100644 --- a/app/components/diffs/stats_component.rb +++ b/app/components/diffs/stats_component.rb @@ -14,14 +14,14 @@ def initialize(diff_files:) def diff_files_data diffs_map = @diff_files.map do |f| { - href: "##{helpers.hexdigest(f.file_path)}", - title: f.new_path, - name: f.file_path, - path: diff_file_path_text(f), - icon: diff_file_changed_icon(f), - iconColor: diff_file_changed_icon_color(f).to_s, - added: f.added_lines, - removed: f.removed_lines + href: "##{helpers.hexdigest(f.file_path)}", + title: f.new_path, + name: f.file_path, + path: diff_file_path_text(f), + icon: diff_file_changed_icon(f), + iconColor: diff_file_changed_icon_color(f).to_s, + added: f.added_lines, + removed: f.removed_lines } end diff --git a/app/controllers/admin/ci/variables_controller.rb b/app/controllers/admin/ci/variables_controller.rb index 7d643435ddb872ac7149ac74ad1dd4628c319414..b29d1089da3295b11257df06d9029265380f03a7 100644 --- a/app/controllers/admin/ci/variables_controller.rb +++ b/app/controllers/admin/ci/variables_controller.rb @@ -32,8 +32,8 @@ def variables def render_instance_variables render status: :ok, json: { - variables: Ci::InstanceVariableSerializer.new.represent(variables) - } + variables: Ci::InstanceVariableSerializer.new.represent(variables) + } end def render_error(errors) diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb index 41f95addc66a54a010b590d30e968200562d10a9..96fb73cedfe8e7914f5f1edbcd5d4860849b55f2 100644 --- a/app/controllers/admin/system_info_controller.rb +++ b/app/controllers/admin/system_info_controller.rb @@ -59,11 +59,11 @@ def show begin disk = Sys::Filesystem.stat(mount.mount_point) @disks.push({ - bytes_total: disk.bytes_total, - bytes_used: disk.bytes_used, - disk_name: mount.name, - mount_path: disk.path - }) + bytes_total: disk.bytes_total, + bytes_used: disk.bytes_used, + disk_name: mount.name, + mount_path: disk.path + }) rescue Sys::Filesystem::Error end end diff --git a/app/controllers/concerns/milestone_actions.rb b/app/controllers/concerns/milestone_actions.rb index 0a859bd3af9e6253de533f47643da3c25dbd7f60..e1967c50d701ade840cb225fecb46800e655b0b2 100644 --- a/app/controllers/concerns/milestone_actions.rb +++ b/app/controllers/concerns/milestone_actions.rb @@ -8,9 +8,9 @@ def issues format.html { redirect_to milestone_redirect_path } format.json do render json: tabs_json("shared/milestones/_issues_tab", { - issues: @milestone.sorted_issues(current_user), # rubocop:disable Gitlab/ModuleWithInstanceVariables - show_project_name: Gitlab::Utils.to_boolean(params[:show_project_name]) - }) + issues: @milestone.sorted_issues(current_user), # rubocop:disable Gitlab/ModuleWithInstanceVariables + show_project_name: Gitlab::Utils.to_boolean(params[:show_project_name]) + }) end end end @@ -20,9 +20,9 @@ def merge_requests format.html { redirect_to milestone_redirect_path } format.json do render json: tabs_json("shared/milestones/_merge_requests_tab", { - merge_requests: @milestone.sorted_merge_requests(current_user).preload_milestoneish_associations, # rubocop:disable Gitlab/ModuleWithInstanceVariables - show_project_name: Gitlab::Utils.to_boolean(params[:show_project_name]) - }) + merge_requests: @milestone.sorted_merge_requests(current_user).preload_milestoneish_associations, # rubocop:disable Gitlab/ModuleWithInstanceVariables + show_project_name: Gitlab::Utils.to_boolean(params[:show_project_name]) + }) end end end @@ -32,8 +32,8 @@ def participants format.html { redirect_to milestone_redirect_path } format.json do render json: tabs_json("shared/milestones/_participants_tab", { - users: @milestone.issue_participants_visible_by_user(current_user) # rubocop:disable Gitlab/ModuleWithInstanceVariables - }) + users: @milestone.issue_participants_visible_by_user(current_user) # rubocop:disable Gitlab/ModuleWithInstanceVariables + }) end end end @@ -46,10 +46,10 @@ def labels milestone_labels = @milestone.issue_labels_visible_by_user(current_user) render json: tabs_json("shared/milestones/_labels_tab", { - labels: milestone_labels.map do |label| - label.present(issuable_subject: @milestone.resource_parent) - end - }) + labels: milestone_labels.map do |label| + label.present(issuable_subject: @milestone.resource_parent) + end + }) end end end diff --git a/app/controllers/concerns/render_service_results.rb b/app/controllers/concerns/render_service_results.rb index 0149a71d9f563a0c5bd5cca491a5714a6aed71ce..83b880096be2311d633e5a410d06b1bd10563d40 100644 --- a/app/controllers/concerns/render_service_results.rb +++ b/app/controllers/concerns/render_service_results.rb @@ -5,25 +5,25 @@ module RenderServiceResults def success_response(result) render({ - status: result[:http_status], - json: result[:body] - }) + status: result[:http_status], + json: result[:body] + }) end def continue_polling_response render({ - status: :no_content, - json: { - status: _('processing'), - message: _('Not ready yet. Try again later.') - } - }) + status: :no_content, + json: { + status: _('processing'), + message: _('Not ready yet. Try again later.') + } + }) end def error_response(result) render({ - status: result[:http_status] || :bad_request, - json: { status: result[:status], message: result[:message] } - }) + status: result[:http_status] || :bad_request, + json: { status: result[:status], message: result[:message] } + }) end end diff --git a/app/controllers/concerns/sourcegraph_decorator.rb b/app/controllers/concerns/sourcegraph_decorator.rb index 061990a4361d0b7e237c506bb884059944b655fb..4aeace1ca67ac18e347bfe80bc4dab736c87b3d5 100644 --- a/app/controllers/concerns/sourcegraph_decorator.rb +++ b/app/controllers/concerns/sourcegraph_decorator.rb @@ -22,8 +22,8 @@ def push_sourcegraph_gon return unless sourcegraph_enabled? gon.push({ - sourcegraph: { url: Gitlab::CurrentSettings.sourcegraph_url } - }) + sourcegraph: { url: Gitlab::CurrentSettings.sourcegraph_url } + }) end def sourcegraph_enabled? diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 0933f2bb7ea396f252ab2a8b1de56b5b87dae10f..6cfe8308952bd8d3510b6852566350f9d25f617a 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -186,9 +186,9 @@ def setup_webauthn_registration def u2f_registrations current_user.u2f_registrations.map do |u2f_registration| { - name: u2f_registration.name, - created_at: u2f_registration.created_at, - delete_path: profile_u2f_registration_path(u2f_registration) + name: u2f_registration.name, + created_at: u2f_registration.created_at, + delete_path: profile_u2f_registration_path(u2f_registration) } end end @@ -196,9 +196,9 @@ def u2f_registrations def webauthn_registrations current_user.webauthn_registrations.map do |webauthn_registration| { - name: webauthn_registration.name, - created_at: webauthn_registration.created_at, - delete_path: profile_webauthn_registration_path(webauthn_registration) + name: webauthn_registration.name, + created_at: webauthn_registration.created_at, + delete_path: profile_webauthn_registration_path(webauthn_registration) } end end diff --git a/app/controllers/projects/badges_controller.rb b/app/controllers/projects/badges_controller.rb index 42bd87e1c01f5e6cf4401867846afec413d0f284..dbbffc4c283b8579477c632dde87f928c24086b8 100644 --- a/app/controllers/projects/badges_controller.rb +++ b/app/controllers/projects/badges_controller.rb @@ -13,10 +13,10 @@ class Projects::BadgesController < Projects::ApplicationController def pipeline pipeline_status = Gitlab::Ci::Badge::Pipeline::Status .new(project, params[:ref], opts: { - ignore_skipped: params[:ignore_skipped], - key_text: params[:key_text], - key_width: params[:key_width] - }) + ignore_skipped: params[:ignore_skipped], + key_text: params[:key_text], + key_width: params[:key_width] + }) render_badge pipeline_status end @@ -24,13 +24,13 @@ def pipeline def coverage coverage_report = Gitlab::Ci::Badge::Coverage::Report .new(project, params[:ref], opts: { - job: params[:job], - key_text: params[:key_text], - key_width: params[:key_width], - min_good: params[:min_good], - min_acceptable: params[:min_acceptable], - min_medium: params[:min_medium] - }) + job: params[:job], + key_text: params[:key_text], + key_width: params[:key_width], + min_good: params[:min_good], + min_acceptable: params[:min_acceptable], + min_medium: params[:min_medium] + }) render_badge coverage_report end @@ -38,10 +38,10 @@ def coverage def release latest_release = Gitlab::Ci::Badge::Release::LatestRelease .new(project, current_user, opts: { - key_text: params[:key_text], - key_width: params[:key_width], - order_by: params[:order_by] - }) + key_text: params[:key_text], + key_width: params[:key_width], + order_by: params[:order_by] + }) render_badge latest_release end diff --git a/app/controllers/repositories/lfs_locks_api_controller.rb b/app/controllers/repositories/lfs_locks_api_controller.rb index f36126d67ffc4e92ca666d7fac9c39d45dddc69a..28d899cb27046e1021d0d35d9eb1d804db8cd015 100644 --- a/app/controllers/repositories/lfs_locks_api_controller.rb +++ b/app/controllers/repositories/lfs_locks_api_controller.rb @@ -54,9 +54,9 @@ def build_payload(data, process) def error_payload(message, custom_attrs = {}) custom_attrs.merge({ - message: message, - documentation_url: help_url - }) + message: message, + documentation_url: help_url + }) end def split_by_owner(locks) diff --git a/app/experiments/concerns/project_commit_count.rb b/app/experiments/concerns/project_commit_count.rb index 706a1a24640d67cb6d9b88faeb3273ca84de3bf5..3f08538c21f162f250ce95ac9a89f3bef04c4833 100644 --- a/app/experiments/concerns/project_commit_count.rb +++ b/app/experiments/concerns/project_commit_count.rb @@ -10,9 +10,9 @@ def commit_count_for(project, default_count: 0, max_count: nil, **exception_deta return default_count unless root_ref Gitlab::GitalyClient::CommitService.new(raw_repo).commit_count(root_ref, { - all: true, # include all branches - max_count: max_count # limit as an optimization - }) + all: true, # include all branches + max_count: max_count # limit as an optimization + }) rescue StandardError => e Gitlab::ErrorTracking.track_exception(e, exception_details) diff --git a/app/graphql/mutations/clusters/agent_tokens/create.rb b/app/graphql/mutations/clusters/agent_tokens/create.rb index a99a54fa5edabb2304a924c06c550861d5f1930f..c10e16333507f786a223150f9e5f5af32e229c6e 100644 --- a/app/graphql/mutations/clusters/agent_tokens/create.rb +++ b/app/graphql/mutations/clusters/agent_tokens/create.rb @@ -49,9 +49,9 @@ def resolve(args) payload = result.payload { - secret: payload[:secret], - token: payload[:token], - errors: Array.wrap(result.message) + secret: payload[:secret], + token: payload[:token], + errors: Array.wrap(result.message) } end diff --git a/app/graphql/mutations/notes/create/diff_note.rb b/app/graphql/mutations/notes/create/diff_note.rb index 7b8c06fd104336141537fe40c1528d63e91e84d2..df2bd55106eb935d35bb21842276c530d7bae3ee 100644 --- a/app/graphql/mutations/notes/create/diff_note.rb +++ b/app/graphql/mutations/notes/create/diff_note.rb @@ -31,10 +31,10 @@ def ready?(**args) def create_note_params(noteable, args) super(noteable, args).merge({ - type: 'DiffNote', - position: position(noteable, args), - merge_request_diff_head_sha: args[:position][:head_sha] - }) + type: 'DiffNote', + position: position(noteable, args), + merge_request_diff_head_sha: args[:position][:head_sha] + }) end def position(noteable, args) diff --git a/app/graphql/mutations/notes/create/image_diff_note.rb b/app/graphql/mutations/notes/create/image_diff_note.rb index d94fd4d6ff8cbb68b6b2dd9e8a9a570cc3c5afa9..3de93e4f5c1ed011ddf4b4e2d18e3714d95986cb 100644 --- a/app/graphql/mutations/notes/create/image_diff_note.rb +++ b/app/graphql/mutations/notes/create/image_diff_note.rb @@ -15,9 +15,9 @@ class ImageDiffNote < Base def create_note_params(noteable, args) super(noteable, args).merge({ - type: 'DiffNote', - position: position(noteable, args) - }) + type: 'DiffNote', + position: position(noteable, args) + }) end def position(noteable, args) diff --git a/app/graphql/mutations/notes/create/note.rb b/app/graphql/mutations/notes/create/note.rb index 4d6f056de09f4261acf0d454d07091fd4b479e19..9b105b7fe1c80293cbd32b6b818f6628cbb8529b 100644 --- a/app/graphql/mutations/notes/create/note.rb +++ b/app/graphql/mutations/notes/create/note.rb @@ -31,9 +31,9 @@ def create_note_params(noteable, args) end super(noteable, args).merge({ - in_reply_to_discussion_id: discussion_id, - merge_request_diff_head_sha: args[:merge_request_diff_head_sha] - }) + in_reply_to_discussion_id: discussion_id, + merge_request_diff_head_sha: args[:merge_request_diff_head_sha] + }) end def authorize_discussion!(discussion) diff --git a/app/graphql/mutations/todos/restore_many.rb b/app/graphql/mutations/todos/restore_many.rb index 20913a9e7da62e76295fe347ac4d45f40fa76439..f2f944860c26ce27d91b91a15f13c9f9928b9d3c 100644 --- a/app/graphql/mutations/todos/restore_many.rb +++ b/app/graphql/mutations/todos/restore_many.rb @@ -23,9 +23,9 @@ def resolve(ids:) updated_ids = restore(todos) { - updated_ids: updated_ids, - todos: Todo.id_in(updated_ids), - errors: errors_on_objects(todos) + updated_ids: updated_ids, + todos: Todo.id_in(updated_ids), + errors: errors_on_objects(todos) } end diff --git a/app/graphql/resolvers/group_packages_resolver.rb b/app/graphql/resolvers/group_packages_resolver.rb index e6a6abb39dda647c97cac09c626fbade0e4d5e25..ae578390fd5ef279fa07473cd473c8ca5407612a 100644 --- a/app/graphql/resolvers/group_packages_resolver.rb +++ b/app/graphql/resolvers/group_packages_resolver.rb @@ -13,9 +13,9 @@ class GroupPackagesResolver < PackagesBaseResolver default_value: :created_desc GROUP_SORT_TO_PARAMS_MAP = SORT_TO_PARAMS_MAP.merge({ - project_path_desc: { order_by: 'project_path', sort: 'desc' }, - project_path_asc: { order_by: 'project_path', sort: 'asc' } - }).freeze + project_path_desc: { order_by: 'project_path', sort: 'desc' }, + project_path_asc: { order_by: 'project_path', sort: 'asc' } + }).freeze def resolve(sort:, **filters) return unless packages_available?