about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-03-10 10:32:37 -0500
committerGitHub <noreply@github.com>2023-03-10 16:32:37 +0100
commit3ea0856f707c0b59914d616608ae15cc6d9a9e1a (patch)
tree75e35a71ff02d1ef8849dce440324e19435785bf
parent8931f18a218ed910cc242f680a81b533cc270ad3 (diff)
Enable RSpec/FilePath (#23965)
-rw-r--r--.rubocop.yml17
-rw-r--r--.rubocop_todo.yml72
2 files changed, 17 insertions, 72 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index b4387a461..99206e597 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -96,9 +96,26 @@ Rails/Exit:
     - 'lib/mastodon/cli_helper.rb'
     - 'lib/cli.rb'
 
+# Reason: Some single letter camel case files shouldn't be split
+# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
 RSpec/FilePath:
   CustomTransform:
+    ActivityPub: activitypub # Ignore the snake_case due to the amount of files to rename
     DeepL: deepl
+    FetchOEmbedService: fetch_oembed_service
+    JsonLdHelper: jsonld_helper
+    OEmbedController: oembed_controller
+    OStatus: ostatus
+    NodeInfoController: nodeinfo_controller # NodeInfo isn't snake_cased for any of the instances
+  Exclude:
+    - 'spec/config/initializers/rack_attack_spec.rb' # namespaces usually have separate folder
+    - 'spec/lib/sanitize_config_spec.rb' # namespaces usually have separate folder
+    - 'spec/controllers/concerns/account_controller_concern_spec.rb' # Concerns describe ApplicationController and don't fit naming
+    - 'spec/controllers/concerns/export_controller_concern_spec.rb'
+    - 'spec/controllers/concerns/localized_spec.rb'
+    - 'spec/controllers/concerns/rate_limit_headers_spec.rb'
+    - 'spec/controllers/concerns/signature_verification_spec.rb'
+    - 'spec/controllers/concerns/user_tracking_concern_spec.rb'
 
 RSpec/NotToNot:
   EnforcedStyle: to_not
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 0035478c4..a9727f939 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -655,78 +655,6 @@ RSpec/ExpectInHook:
     - 'spec/controllers/settings/applications_controller_spec.rb'
     - 'spec/lib/status_filter_spec.rb'
 
-# Offense count: 61
-# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
-# Include: **/*_spec*rb*, **/spec/**/*
-RSpec/FilePath:
-  Exclude:
-    - 'spec/config/initializers/rack_attack_spec.rb'
-    - 'spec/controllers/activitypub/claims_controller_spec.rb'
-    - 'spec/controllers/activitypub/collections_controller_spec.rb'
-    - 'spec/controllers/activitypub/followers_synchronizations_controller_spec.rb'
-    - 'spec/controllers/activitypub/inboxes_controller_spec.rb'
-    - 'spec/controllers/activitypub/outboxes_controller_spec.rb'
-    - 'spec/controllers/activitypub/replies_controller_spec.rb'
-    - 'spec/controllers/admin/change_email_controller_spec.rb'
-    - 'spec/controllers/admin/users/roles_controller.rb'
-    - 'spec/controllers/api/oembed_controller_spec.rb'
-    - 'spec/controllers/concerns/account_controller_concern_spec.rb'
-    - 'spec/controllers/concerns/export_controller_concern_spec.rb'
-    - 'spec/controllers/concerns/localized_spec.rb'
-    - 'spec/controllers/concerns/rate_limit_headers_spec.rb'
-    - 'spec/controllers/concerns/signature_verification_spec.rb'
-    - 'spec/controllers/concerns/user_tracking_concern_spec.rb'
-    - 'spec/controllers/well_known/nodeinfo_controller_spec.rb'
-    - 'spec/helpers/admin/action_log_helper_spec.rb'
-    - 'spec/helpers/jsonld_helper_spec.rb'
-    - 'spec/lib/activitypub/activity/accept_spec.rb'
-    - 'spec/lib/activitypub/activity/add_spec.rb'
-    - 'spec/lib/activitypub/activity/announce_spec.rb'
-    - 'spec/lib/activitypub/activity/block_spec.rb'
-    - 'spec/lib/activitypub/activity/create_spec.rb'
-    - 'spec/lib/activitypub/activity/delete_spec.rb'
-    - 'spec/lib/activitypub/activity/flag_spec.rb'
-    - 'spec/lib/activitypub/activity/follow_spec.rb'
-    - 'spec/lib/activitypub/activity/like_spec.rb'
-    - 'spec/lib/activitypub/activity/move_spec.rb'
-    - 'spec/lib/activitypub/activity/reject_spec.rb'
-    - 'spec/lib/activitypub/activity/remove_spec.rb'
-    - 'spec/lib/activitypub/activity/undo_spec.rb'
-    - 'spec/lib/activitypub/activity/update_spec.rb'
-    - 'spec/lib/activitypub/adapter_spec.rb'
-    - 'spec/lib/activitypub/dereferencer_spec.rb'
-    - 'spec/lib/activitypub/linked_data_signature_spec.rb'
-    - 'spec/lib/activitypub/tag_manager_spec.rb'
-    - 'spec/lib/ostatus/tag_manager_spec.rb'
-    - 'spec/lib/sanitize_config_spec.rb'
-    - 'spec/serializers/activitypub/device_serializer_spec.rb'
-    - 'spec/serializers/activitypub/note_serializer_spec.rb'
-    - 'spec/serializers/activitypub/one_time_key_serializer_spec.rb'
-    - 'spec/serializers/activitypub/undo_like_serializer_spec.rb'
-    - 'spec/serializers/activitypub/vote_serializer_spec.rb'
-    - 'spec/serializers/activitypub/update_poll_serializer_spec.rb'
-    - 'spec/services/activitypub/fetch_featured_collection_service_spec.rb'
-    - 'spec/services/activitypub/fetch_featured_tags_collection_service_spec.rb'
-    - 'spec/services/activitypub/fetch_remote_account_service_spec.rb'
-    - 'spec/services/activitypub/fetch_remote_actor_service_spec.rb'
-    - 'spec/services/activitypub/fetch_remote_key_service_spec.rb'
-    - 'spec/services/activitypub/fetch_remote_status_service_spec.rb'
-    - 'spec/services/activitypub/fetch_replies_service_spec.rb'
-    - 'spec/services/activitypub/process_account_service_spec.rb'
-    - 'spec/services/activitypub/process_collection_service_spec.rb'
-    - 'spec/services/activitypub/process_status_update_service_spec.rb'
-    - 'spec/services/activitypub/synchronize_followers_service_spec.rb'
-    - 'spec/services/fetch_oembed_service_spec.rb'
-    - 'spec/services/remove_from_follwers_service_spec.rb'
-    - 'spec/workers/activitypub/delivery_worker_spec.rb'
-    - 'spec/workers/activitypub/distribute_poll_update_worker_spec.rb'
-    - 'spec/workers/activitypub/distribution_worker_spec.rb'
-    - 'spec/workers/activitypub/fetch_replies_worker_spec.rb'
-    - 'spec/workers/activitypub/move_distribution_worker_spec.rb'
-    - 'spec/workers/activitypub/processing_worker_spec.rb'
-    - 'spec/workers/activitypub/status_update_distribution_worker_spec.rb'
-    - 'spec/workers/activitypub/update_distribution_worker_spec.rb'
-
 # Offense count: 16
 # This cop supports safe autocorrection (--autocorrect).
 # Configuration parameters: EnforcedStyle.