Fix remaining cop offenses for Naming/FileName
Problem
In !72521 (merged) we've re-enabled Naming/FileName
again . It's been auto-disabled by RuboCop because it exceeded the maximum amount of offenses.
This MR enabled the
Proposed solution
Fix the remaining offenses by either
-
renaming a class/module name to match the filename or rename the filename to match class/module name
- Example:
tooling/lib/tooling/images.rb
definesTooling::Image
(missing as
). We'd rename the file totooling/lib/tooling/image.rb
- Example:
-
OR adding an exception for the used acronym to
AllowedAcronyms
list in the configuration- Example:
ee/lib/gitlab/cidr.rb
definesGitlab::CIDR
.CIDR
is not part ofAllowedAcronyms
configuration so RuboCop expect to seeGitlab::Cidr
instead. We'd addCIDR
to the list. - Example:
tooling/lib/tooling/parallel_rspec_runner.rb
definesTooling::ParallelRSpecRunner
but should defineTooling::ParallelRspechRunner
. UsingRSpec
is fine however so we can addRSpec
toAllowedAcronyms
configuration which also will match part of class/module name.
- Example:
-
OR disable
Naming/FileName
👮 inline:- on the very first line put
# rubocop:disable Naming/FileName
(even before magic comments like# frozen_string_literal: true
) - on the very last line put
# rubocop:enable Naming/FileName
- on the very first line put
The list
-
app/controllers/concerns/clientside_preview_csp.rb
-
app/controllers/concerns/one_trust_csp.rb
-
app/controllers/concerns/static_object_external_storage_csp.rb
-
app/models/blob_viewer/csv.rb
-
app/views/issues/_issues_calendar.ics.ruby
-
ee/app/models/dast/branch.rb
-
ee/app/models/sca.rb
-
ee/lib/ee/gitlab/usage_data_counters/hll_redis_counter.rb
-
ee/lib/elastic/v12p1/application_class_proxy.rb
-
ee/lib/elastic/v12p1/application_instance_proxy.rb
-
ee/lib/elastic/v12p1/config.rb
-
ee/lib/elastic/v12p1/issue_class_proxy.rb
-
ee/lib/elastic/v12p1/issue_instance_proxy.rb
-
ee/lib/elastic/v12p1/merge_request_class_proxy.rb
-
ee/lib/elastic/v12p1/merge_request_instance_proxy.rb
-
ee/lib/elastic/v12p1/milestone_class_proxy.rb
-
ee/lib/elastic/v12p1/milestone_instance_proxy.rb
-
ee/lib/elastic/v12p1/note_class_proxy.rb
-
ee/lib/elastic/v12p1/note_instance_proxy.rb
-
ee/lib/elastic/v12p1/project_class_proxy.rb
-
ee/lib/elastic/v12p1/project_instance_proxy.rb
-
ee/lib/elastic/v12p1/project_wiki_class_proxy.rb
-
ee/lib/elastic/v12p1/project_wiki_instance_proxy.rb
-
ee/lib/elastic/v12p1/repository_class_proxy.rb
-
ee/lib/elastic/v12p1/repository_instance_proxy.rb
-
ee/lib/elastic/v12p1/routing.rb
-
ee/lib/elastic/v12p1/snippet_class_proxy.rb
-
ee/lib/elastic/v12p1/snippet_instance_proxy.rb
-
ee/lib/gitlab/auth/smartcard/san_extension.rb
-
ee/lib/gitlab/cidr.rb
-
ee/lib/gitlab/elastic/bool_expr.rb
-
ee/lib/gitlab/spdx/catalogue.rb
-
ee/lib/gitlab/spdx/catalogue_gateway.rb
-
ee/lib/gitlab/spdx/license.rb
-
ee/lib/gitlab/status_page/storage/object.rb
-
haml_lint/inline_javascript.rb
-
lib/api/entities/mr_note.rb
-
lib/api/helpers/sse_helpers.rb
-
lib/gitlab/ci/pipeline/chain/command.rb
-
lib/gitlab/database/migrations/observation.rb
-
lib/gitlab/health_checks/metric.rb
-
lib/gitlab/health_checks/probes/status.rb
-
lib/gitlab/health_checks/result.rb
-
lib/gitlab/jwt_token.rb
-
lib/gitlab/middleware/release_env.rb
-
lib/gitlab/redis/hll.rb
-
lib/gitlab/slash_commands/result.rb
-
lib/gitlab/template_parser/ast.rb
-
lib/gitlab/usage/metrics/instrumentations/redis_hll_metric.rb
-
lib/gitlab/usage_data_counters/hll_redis_counter.rb
-
lib/gitlab/usage_data_counters/vs_code_extension_activity_unique_counter.rb
-
qa/qa/fixtures/auto_devops_rack/config.ru
-
qa/qa/resource/user_gpg.rb
-
qa/qa/runtime/gpg.rb
-
qa/qa/runtime/key/ecdsa.rb
-
qa/qa/runtime/key/ed25519.rb
-
qa/qa/support/otp.rb
-
qa/qa/tools/initialize_gitlab_auth.rb
-
rubocop/cop/gitlab/change_timzone.rb
-
rubocop/cop/gitlab/keys-first-and-values-first.rb
-
rubocop/cop/graphql/gid_expected_type.rb
-
rubocop/cop/performance/ar_count_each.rb
-
rubocop/cop/performance/ar_exists_and_present_blank.rb
-
rubocop/rubocop.rb
-
tooling/lib/tooling/images.rb
-
tooling/lib/tooling/parallel_rspec_runner.rb
Edited by yhgupta