diff --git a/.rubocop_todo/style/empty_method.yml b/.rubocop_todo/style/empty_method.yml index 342c80e2a54d0b74e06a213e0722496a3ab46db1..28344d412058ab551c6e66a0f46fd0c56100a6cd 100644 --- a/.rubocop_todo/style/empty_method.yml +++ b/.rubocop_todo/style/empty_method.yml @@ -2,42 +2,6 @@ # Cop supports --autocorrect. Style/EmptyMethod: Exclude: - - 'app/controllers/admin/application_settings/appearances_controller.rb' - - 'app/controllers/admin/applications_controller.rb' - - 'app/controllers/admin/deploy_keys_controller.rb' - - 'app/controllers/admin/identities_controller.rb' - - 'app/controllers/admin/labels_controller.rb' - - 'app/controllers/admin/topics_controller.rb' - - 'app/controllers/admin/usage_trends_controller.rb' - - 'app/controllers/concerns/boards_actions.rb' - - 'app/controllers/groups/milestones_controller.rb' - - 'app/controllers/groups/settings/applications_controller.rb' - - 'app/controllers/groups/settings/ci_cd_controller.rb' - - 'app/controllers/groups/settings/packages_and_registries_controller.rb' - - 'app/controllers/help_controller.rb' - - 'app/controllers/import/bitbucket_server_controller.rb' - - 'app/controllers/import/fogbugz_controller.rb' - - 'app/controllers/import/manifest_controller.rb' - - 'app/controllers/profiles/preferences_controller.rb' - - 'app/controllers/projects/alert_management_controller.rb' - - 'app/controllers/projects/ci/lints_controller.rb' - - 'app/controllers/projects/ci/pipeline_editor_controller.rb' - - 'app/controllers/projects/confluences_controller.rb' - - 'app/controllers/projects/deploy_keys_controller.rb' - - 'app/controllers/projects/environments_controller.rb' - - 'app/controllers/projects/feature_flags_controller.rb' - - 'app/controllers/projects/feature_flags_user_lists_controller.rb' - - 'app/controllers/projects/import/jira_controller.rb' - - 'app/controllers/projects/imports_controller.rb' - - 'app/controllers/projects/incidents_controller.rb' - - 'app/controllers/projects/jobs_controller.rb' - - 'app/controllers/projects/labels_controller.rb' - - 'app/controllers/projects/mattermosts_controller.rb' - - 'app/controllers/projects/pipeline_schedules_controller.rb' - - 'app/controllers/projects/settings/packages_and_registries_controller.rb' - - 'app/controllers/projects/terraform_controller.rb' - - 'app/controllers/pwa_controller.rb' - - 'app/controllers/search_controller.rb' - 'app/graphql/resolvers/concerns/caching_array_resolver.rb' - 'app/helpers/subscribable_banner_helper.rb' - 'app/helpers/users/callouts_helper.rb' diff --git a/app/controllers/admin/application_settings/appearances_controller.rb b/app/controllers/admin/application_settings/appearances_controller.rb index 916f81fd4d2ce382a981d48b8571282a6378ccd2..8ed77b6c37dba768367b5b7b74a9ae5d36529485 100644 --- a/app/controllers/admin/application_settings/appearances_controller.rb +++ b/app/controllers/admin/application_settings/appearances_controller.rb @@ -6,8 +6,7 @@ class Admin::ApplicationSettings::AppearancesController < Admin::ApplicationCont feature_category :navigation urgency :low - def show - end + def show; end def preview_sign_in render 'preview_sign_in', layout: 'devise' diff --git a/app/controllers/admin/applications_controller.rb b/app/controllers/admin/applications_controller.rb index c9419354c2324298a75274aba30e1ab57f29b472..2bb665c1fe1d739cde789590c5459099fc9aca85 100644 --- a/app/controllers/admin/applications_controller.rb +++ b/app/controllers/admin/applications_controller.rb @@ -19,8 +19,7 @@ def new @application = Doorkeeper::Application.new end - def edit - end + def edit; end def create @application = Applications::CreateService.new(current_user, application_params).execute(request) diff --git a/app/controllers/admin/deploy_keys_controller.rb b/app/controllers/admin/deploy_keys_controller.rb index 4db1ba958ed4b00f1c4b43db8fc82c24c2f419ca..c9e0aa0492628fd4434d37ec2a4b59281072c5ca 100644 --- a/app/controllers/admin/deploy_keys_controller.rb +++ b/app/controllers/admin/deploy_keys_controller.rb @@ -7,8 +7,7 @@ class Admin::DeployKeysController < Admin::ApplicationController feature_category :continuous_delivery urgency :low - def index - end + def index; end def new @deploy_key = deploy_keys.new @@ -23,8 +22,7 @@ def create end end - def edit - end + def edit; end def update if deploy_key.update(update_params) diff --git a/app/controllers/admin/identities_controller.rb b/app/controllers/admin/identities_controller.rb index 75c8a7110f663ea22481cba46a2238f5df46c2c9..c79840885680406b51a5e4e8d7ad06b7ff88ad87 100644 --- a/app/controllers/admin/identities_controller.rb +++ b/app/controllers/admin/identities_controller.rb @@ -32,8 +32,7 @@ def index end end - def edit - end + def edit; end def update if @identity.update(identity_params) diff --git a/app/controllers/admin/labels_controller.rb b/app/controllers/admin/labels_controller.rb index abed42a160e4d8c88f138985a482d36b30b0a86a..7128b3b6d7d1f7b5d66171610a64e1adc77ed834 100644 --- a/app/controllers/admin/labels_controller.rb +++ b/app/controllers/admin/labels_controller.rb @@ -10,15 +10,13 @@ def index @labels = Label.templates.page(pagination_params[:page]) end - def show - end + def show; end def new @label = Label.new end - def edit - end + def edit; end def create @label = Labels::CreateService.new(label_params).execute(template: true) diff --git a/app/controllers/admin/topics_controller.rb b/app/controllers/admin/topics_controller.rb index c031a4762d53ea0a191470d6513be8db7a9caaa9..d55bd4255b0d5a783681e0da88c19df57e6e5776 100644 --- a/app/controllers/admin/topics_controller.rb +++ b/app/controllers/admin/topics_controller.rb @@ -16,8 +16,7 @@ def new @topic = Projects::Topic.new end - def edit - end + def edit; end def create @topic = Projects::Topic.new(topic_params) diff --git a/app/controllers/admin/usage_trends_controller.rb b/app/controllers/admin/usage_trends_controller.rb index f88028535c10b7fa042d317335864b8840f949be..c9f151e48a0df6da7c8293cc587a87d501f18801 100644 --- a/app/controllers/admin/usage_trends_controller.rb +++ b/app/controllers/admin/usage_trends_controller.rb @@ -13,8 +13,7 @@ class Admin::UsageTrendsController < Admin::ApplicationController urgency :low - def index - end + def index; end def tracking_namespace_source @group diff --git a/app/controllers/concerns/boards_actions.rb b/app/controllers/concerns/boards_actions.rb index 42bf6c68aa71616f6163dd3315f5d3690370f125..188e77c8168fc47b0ae6503ac9cc010c30290131 100644 --- a/app/controllers/concerns/boards_actions.rb +++ b/app/controllers/concerns/boards_actions.rb @@ -36,8 +36,7 @@ def latest_visited_board end # Noop on FOSS - def push_licensed_features - end + def push_licensed_features; end def board strong_memoize(:board) do diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 5024ef488736bc796d821a2a893d030ec0a4aff8..0c91631ab7b4deeb7bc822b61fec0d037719d62d 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -35,11 +35,9 @@ def create end end - def show - end + def show; end - def edit - end + def edit; end def update Milestones::UpdateService.new(@milestone.parent, current_user, milestone_params).execute(@milestone) diff --git a/app/controllers/groups/settings/applications_controller.rb b/app/controllers/groups/settings/applications_controller.rb index 5aea078db17f17d449aa44af34209ea8d0cf57c9..a3282e0a5d3d84c99c821b30b1cbf2198fd8eb3f 100644 --- a/app/controllers/groups/settings/applications_controller.rb +++ b/app/controllers/groups/settings/applications_controller.rb @@ -17,8 +17,7 @@ def index def show; end - def edit - end + def edit; end def create @application = Applications::CreateService.new(current_user, application_params).execute(request) diff --git a/app/controllers/groups/settings/ci_cd_controller.rb b/app/controllers/groups/settings/ci_cd_controller.rb index 29ac21ebb6f418ada8fa2c219b9bb7a6df609f0e..bef7fd7060f2a828afa1887bc8a194a669dc3937 100644 --- a/app/controllers/groups/settings/ci_cd_controller.rb +++ b/app/controllers/groups/settings/ci_cd_controller.rb @@ -95,12 +95,10 @@ def update_group_params end # Overridden in EE - def push_licensed_features - end + def push_licensed_features; end # Overridden in EE - def assign_variables_to_gon - end + def assign_variables_to_gon; end end end end diff --git a/app/controllers/groups/settings/packages_and_registries_controller.rb b/app/controllers/groups/settings/packages_and_registries_controller.rb index ec4a0b312eefee81167e439d1b683453f73b922c..2c6f0072880e32052ce29805f04a1e2522061d96 100644 --- a/app/controllers/groups/settings/packages_and_registries_controller.rb +++ b/app/controllers/groups/settings/packages_and_registries_controller.rb @@ -14,8 +14,7 @@ class PackagesAndRegistriesController < Groups::ApplicationController feature_category :package_registry urgency :low - def show - end + def show; end private diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 6b8a78e1bc390f960bf97f1bf48c7e1ef9c945da..f1de3663c87110402b8386bec201d35eb5300442 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -55,8 +55,7 @@ def redirect_to_docs redirect_to documentation_base_url || Gitlab::Saas.doc_url end - def shortcuts - end + def shortcuts; end def instance_configuration @instance_configuration = InstanceConfiguration.new diff --git a/app/controllers/import/bitbucket_server_controller.rb b/app/controllers/import/bitbucket_server_controller.rb index 353150121c7843fc802170229eb85d1ec55642b5..8790f1542573655329cc498861ffe5ec891bd7b6 100644 --- a/app/controllers/import/bitbucket_server_controller.rb +++ b/app/controllers/import/bitbucket_server_controller.rb @@ -25,8 +25,7 @@ class Import::BitbucketServerController < Import::BaseController VALID_BITBUCKET_PROJECT_CHARS = /\A~?[\w\-\.\s]+\z/ VALID_BITBUCKET_CHARS = /\A[\w\-\.\s]+\z/ - def new - end + def new; end def create repo = client.repo(@project_key, @repo_slug) diff --git a/app/controllers/import/fogbugz_controller.rb b/app/controllers/import/fogbugz_controller.rb index 571f6dfda42633e99ae9bc2dc91ffeae2f386085..dbdcbc2a25832b1bf8b66cbd8e1cfd47c5371abb 100644 --- a/app/controllers/import/fogbugz_controller.rb +++ b/app/controllers/import/fogbugz_controller.rb @@ -9,8 +9,7 @@ class Import::FogbugzController < Import::BaseController rescue_from Fogbugz::AuthenticationException, with: :fogbugz_unauthorized - def new - end + def new; end def callback begin @@ -25,8 +24,7 @@ def callback redirect_to new_user_map_import_fogbugz_path(namespace_id: params[:namespace_id]) end - def new_user_map - end + def new_user_map; end def create_user_map user_map = user_map_params.to_h[:users] diff --git a/app/controllers/import/manifest_controller.rb b/app/controllers/import/manifest_controller.rb index 45ff679fec7da24425ee6856eb81914dbad40fa9..f9074297c949372a1d6a14c11c84aeff8f8b93c4 100644 --- a/app/controllers/import/manifest_controller.rb +++ b/app/controllers/import/manifest_controller.rb @@ -7,8 +7,7 @@ class Import::ManifestController < Import::BaseController before_action :verify_import_enabled before_action :ensure_import_vars, only: [:create, :status] - def new - end + def new; end # We need to re-expose controller's internal method 'status' as action. # rubocop:disable Lint/UselessMethodDefinition diff --git a/app/controllers/profiles/preferences_controller.rb b/app/controllers/profiles/preferences_controller.rb index c173ae40879f7926ccd7770d8d60e695056d0b7b..0e9aff1170695632a76999f8f036a337ec2d2862 100644 --- a/app/controllers/profiles/preferences_controller.rb +++ b/app/controllers/profiles/preferences_controller.rb @@ -8,8 +8,7 @@ class Profiles::PreferencesController < Profiles::ApplicationController urgency :low, [:show] urgency :medium, [:update] - def show - end + def show; end def update result = Users::UpdateService.new(current_user, preferences_params.merge(user: user)).execute diff --git a/app/controllers/projects/alert_management_controller.rb b/app/controllers/projects/alert_management_controller.rb index ef0c47b0eed961d6aa9f072906895e9f1689d62a..65c1feb34b4b926b0ca25db1c9b22a333e8b0ea9 100644 --- a/app/controllers/projects/alert_management_controller.rb +++ b/app/controllers/projects/alert_management_controller.rb @@ -6,8 +6,7 @@ class Projects::AlertManagementController < Projects::ApplicationController feature_category :incident_management urgency :low - def index - end + def index; end def details @alert_id = params[:id] diff --git a/app/controllers/projects/ci/lints_controller.rb b/app/controllers/projects/ci/lints_controller.rb index 6762f1c711008be34fea9a00e4ffbe9f359f05fd..94a91d309393c4a4002e7641525bfcc1632b1586 100644 --- a/app/controllers/projects/ci/lints_controller.rb +++ b/app/controllers/projects/ci/lints_controller.rb @@ -8,8 +8,7 @@ class Projects::Ci::LintsController < Projects::ApplicationController respond_to :json, only: [:create] urgency :low, [:create] - def show - end + def show; end def create content = params[:content] diff --git a/app/controllers/projects/ci/pipeline_editor_controller.rb b/app/controllers/projects/ci/pipeline_editor_controller.rb index 62a5baccc6293c9c9383e1c13e91a1fa9e9a0b40..cad809b738c3fbfeb61f69bb660543c15dc770c3 100644 --- a/app/controllers/projects/ci/pipeline_editor_controller.rb +++ b/app/controllers/projects/ci/pipeline_editor_controller.rb @@ -11,8 +11,7 @@ class Projects::Ci::PipelineEditorController < Projects::ApplicationController urgency :low, [:show] - def show - end + def show; end private diff --git a/app/controllers/projects/confluences_controller.rb b/app/controllers/projects/confluences_controller.rb index fccbdf0bf9157d5c12fc6816fc470987c93f2882..337b673852dbdf3986ecef6eb7ea47d446144b5d 100644 --- a/app/controllers/projects/confluences_controller.rb +++ b/app/controllers/projects/confluences_controller.rb @@ -5,8 +5,7 @@ class Projects::ConfluencesController < Projects::ApplicationController feature_category :integrations - def show - end + def show; end private diff --git a/app/controllers/projects/deploy_keys_controller.rb b/app/controllers/projects/deploy_keys_controller.rb index 15db467cb21ee79c66283a300e4a49844894c58a..2f8cfb16e394ad51b546112c8ba9a792fe7f4ae9 100644 --- a/app/controllers/projects/deploy_keys_controller.rb +++ b/app/controllers/projects/deploy_keys_controller.rb @@ -63,8 +63,7 @@ def create redirect_to_repository end - def edit - end + def edit; end def update access_denied! unless deploy_key diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index 75759b49117b7983a404b525337dea9eaa8651ae..2bc434d95145cfb98af33a4d7f945bcf62cdd9b3 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -84,15 +84,13 @@ def folder end # rubocop: enable CodeReuse/ActiveRecord - def show - end + def show; end def new @environment = project.environments.new end - def edit - end + def edit; end def k8s render action: :show diff --git a/app/controllers/projects/feature_flags_controller.rb b/app/controllers/projects/feature_flags_controller.rb index 1ebe9c98960f50eeb9c5578e66dfd77c1da05818..e563c9b6ceae3baf40e173674610e2de6b48ce0d 100644 --- a/app/controllers/projects/feature_flags_controller.rb +++ b/app/controllers/projects/feature_flags_controller.rb @@ -30,8 +30,7 @@ def index end end - def new - end + def new; end def show respond_to do |format| @@ -57,8 +56,7 @@ def create end end - def edit - end + def edit; end def update result = FeatureFlags::UpdateService.new(project, current_user, update_params).execute(feature_flag) diff --git a/app/controllers/projects/feature_flags_user_lists_controller.rb b/app/controllers/projects/feature_flags_user_lists_controller.rb index 023eb51cc94a0584d26519f5bd3a830fc455ffa8..0aade90dfbbfe8768de2188733e5361101d8c7b1 100644 --- a/app/controllers/projects/feature_flags_user_lists_controller.rb +++ b/app/controllers/projects/feature_flags_user_lists_controller.rb @@ -7,17 +7,13 @@ class Projects::FeatureFlagsUserListsController < Projects::ApplicationControlle feature_category :feature_flags urgency :low - def index - end + def index; end - def new - end + def new; end - def edit - end + def edit; end - def show - end + def show; end private diff --git a/app/controllers/projects/import/jira_controller.rb b/app/controllers/projects/import/jira_controller.rb index 46c4761b0ea7ec4465d639e0a0e25e9f8db373cf..712cf5297c385c1dbde54820720940d8d05389f3 100644 --- a/app/controllers/projects/import/jira_controller.rb +++ b/app/controllers/projects/import/jira_controller.rb @@ -9,8 +9,7 @@ class JiraController < Projects::ApplicationController feature_category :integrations - def show - end + def show; end private diff --git a/app/controllers/projects/imports_controller.rb b/app/controllers/projects/imports_controller.rb index 4a87c3775000097c11ee4a0c4fe523870d040cd2..bd4d13ac93ae1648ea14ab3443190c38f8526a67 100644 --- a/app/controllers/projects/imports_controller.rb +++ b/app/controllers/projects/imports_controller.rb @@ -14,8 +14,7 @@ class Projects::ImportsController < Projects::ApplicationController feature_category :importers urgency :low - def new - end + def new; end def create @project.import_state.reset.schedule if @project.update(import_params) diff --git a/app/controllers/projects/incidents_controller.rb b/app/controllers/projects/incidents_controller.rb index e050c0c76ae8426265ad8f31e5eb6cfaadc96579..218b2505a63e68bcf71227b9d4dcd4fa86cdaa0b 100644 --- a/app/controllers/projects/incidents_controller.rb +++ b/app/controllers/projects/incidents_controller.rb @@ -16,8 +16,7 @@ class Projects::IncidentsController < Projects::ApplicationController feature_category :incident_management urgency :low - def index - end + def index; end private diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index 4e62541f44259a745fe3af5815671049f39913dc..8ea33911ec860f5547b7bbc2e5f4e309a85c977a 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -178,8 +178,7 @@ def test_report_summary end end - def terminal - end + def terminal; end # GET .../terminal.ws : implemented in gitlab-workhorse def terminal_websocket_authorize diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index 0d8876a822cb78557c70845b3a19f5c93eebde3c..8d900e91a494c794f21925483bf8269ef9000210 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -52,8 +52,7 @@ def create end end - def edit - end + def edit; end def update @label = Labels::UpdateService.new(label_params).execute(@label) diff --git a/app/controllers/projects/mattermosts_controller.rb b/app/controllers/projects/mattermosts_controller.rb index 9a3e7e31d68279e32979074e7abf43a30979b6d8..e058002a95f637978f6afe536fb0ed3189330ebb 100644 --- a/app/controllers/projects/mattermosts_controller.rb +++ b/app/controllers/projects/mattermosts_controller.rb @@ -12,8 +12,7 @@ class Projects::MattermostsController < Projects::ApplicationController feature_category :integrations - def new - end + def new; end def create result, message = integration.configure(current_user, configure_params) diff --git a/app/controllers/projects/pipeline_schedules_controller.rb b/app/controllers/projects/pipeline_schedules_controller.rb index 6aaedfad7f6c48a44cae4c68e61d4cfe6bea5e33..253c3586c576e8240bb2750b11022c7fe68cd73e 100644 --- a/app/controllers/projects/pipeline_schedules_controller.rb +++ b/app/controllers/projects/pipeline_schedules_controller.rb @@ -19,8 +19,7 @@ def index @schedules = Ci::PipelineSchedulesFinder.new(@project).execute(scope: params[:scope]) end - def new - end + def new; end def create response = Ci::PipelineSchedules::CreateService.new(@project, current_user, schedule_params).execute @@ -33,8 +32,7 @@ def create end end - def edit - end + def edit; end def update response = Ci::PipelineSchedules::UpdateService.new(schedule, current_user, schedule_params).execute diff --git a/app/controllers/projects/settings/packages_and_registries_controller.rb b/app/controllers/projects/settings/packages_and_registries_controller.rb index 4a3235bf9f30eb287e3497be7645bbca9b27ab40..f64239b527fe6afef36dea6f468341efad09c569 100644 --- a/app/controllers/projects/settings/packages_and_registries_controller.rb +++ b/app/controllers/projects/settings/packages_and_registries_controller.rb @@ -13,8 +13,7 @@ class PackagesAndRegistriesController < Projects::ApplicationController feature_category :package_registry urgency :low - def show - end + def show; end def cleanup_tags registry_settings_enabled! diff --git a/app/controllers/projects/terraform_controller.rb b/app/controllers/projects/terraform_controller.rb index ed1783bb43d307e46bf81aa71cd2951219483634..ee8477ca029a1c2996e0926d475f7e145361505e 100644 --- a/app/controllers/projects/terraform_controller.rb +++ b/app/controllers/projects/terraform_controller.rb @@ -6,8 +6,7 @@ class Projects::TerraformController < Projects::ApplicationController feature_category :infrastructure_as_code urgency :low - def index - end + def index; end private diff --git a/app/controllers/pwa_controller.rb b/app/controllers/pwa_controller.rb index 8de1b10e1f19c3a11acc57272fd9d53710ecb8af..e8b265aaea6cb0ad73732b2beb698dbf78253175 100644 --- a/app/controllers/pwa_controller.rb +++ b/app/controllers/pwa_controller.rb @@ -8,9 +8,7 @@ class PwaController < ApplicationController # rubocop:disable Gitlab/NamespacedC skip_before_action :authenticate_user! - def manifest - end + def manifest; end - def offline - end + def offline; end end diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 056e76e9a80db5abe0a9ad3f10863ddca4d8b40f..9e4c69e467bee8911be5f9a950612eb25a1c8733 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -152,8 +152,7 @@ def autocomplete render json: Gitlab::Json.dump(search_autocomplete_opts(term, filter: @filter, scope: @scope)) end - def opensearch - end + def opensearch; end private