diff --git a/.rubocop.yml b/.rubocop.yml index 63de5e17c..68352e319 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -109,16 +109,11 @@ Rails/Exit: # 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 + ActivityPub: activitypub 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 # Reason: # https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnamedsubject @@ -135,6 +130,16 @@ RSpec/NotToNot: RSpec/Rails/HttpStatus: EnforcedStyle: numeric +# Reason: Match overrides from Rspec/FilePath rule above +# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecspecfilepathformat +RSpec/SpecFilePathFormat: + CustomTransform: + ActivityPub: activitypub + DeepL: deepl + FetchOEmbedService: fetch_oembed_service + OEmbedController: oembed_controller + OStatus: ostatus + # Reason: # https://docs.rubocop.org/rubocop/cops_style.html#styleclassandmodulechildren Style/ClassAndModuleChildren: diff --git a/Gemfile.lock b/Gemfile.lock index 527f03275..560b50cb4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -659,11 +659,11 @@ GEM rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) rubocop-capybara (2.19.0) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) + rubocop-factory_bot (2.24.0) rubocop (~> 1.33) rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) @@ -672,8 +672,8 @@ GEM activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.23.2) - rubocop (~> 1.33) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-prof (1.6.3) diff --git a/app/controllers/well_known/nodeinfo_controller.rb b/app/controllers/well_known/node_info_controller.rb similarity index 100% rename from app/controllers/well_known/nodeinfo_controller.rb rename to app/controllers/well_known/node_info_controller.rb diff --git a/app/lib/nodeinfo/adapter.rb b/app/lib/node_info/adapter.rb similarity index 100% rename from app/lib/nodeinfo/adapter.rb rename to app/lib/node_info/adapter.rb diff --git a/app/serializers/nodeinfo/discovery_serializer.rb b/app/serializers/node_info/discovery_serializer.rb similarity index 100% rename from app/serializers/nodeinfo/discovery_serializer.rb rename to app/serializers/node_info/discovery_serializer.rb diff --git a/app/serializers/nodeinfo/serializer.rb b/app/serializers/node_info/serializer.rb similarity index 100% rename from app/serializers/nodeinfo/serializer.rb rename to app/serializers/node_info/serializer.rb diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 727a1350d..3d1750945 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -20,7 +20,6 @@ ActiveSupport::Inflector.inflections(:en) do |inflect| inflect.acronym 'PubSubHubbub' inflect.acronym 'ActivityStreams' inflect.acronym 'JsonLd' - inflect.acronym 'NodeInfo' inflect.acronym 'Ed25519' inflect.acronym 'TOC' inflect.acronym 'RSS' diff --git a/config/routes.rb b/config/routes.rb index ce3fd9596..3735e4201 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,12 +51,12 @@ Rails.application.routes.draw do end get '.well-known/host-meta', to: 'well_known/host_meta#show', as: :host_meta, defaults: { format: 'xml' } - get '.well-known/nodeinfo', to: 'well_known/nodeinfo#index', as: :nodeinfo, defaults: { format: 'json' } + get '.well-known/nodeinfo', to: 'well_known/node_info#index', as: :nodeinfo, defaults: { format: 'json' } get '.well-known/webfinger', to: 'well_known/webfinger#show', as: :webfinger get '.well-known/change-password', to: redirect('/auth/edit') get '.well-known/proxy', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" } - get '/nodeinfo/2.0', to: 'well_known/nodeinfo#show', as: :nodeinfo_schema + get '/nodeinfo/2.0', to: 'well_known/node_info#show', as: :nodeinfo_schema get 'manifest', to: 'manifests#show', defaults: { format: 'json' } get 'intent', to: 'intents#show' diff --git a/spec/config/initializers/rack_attack_spec.rb b/spec/config/initializers/rack/attack_spec.rb similarity index 100% rename from spec/config/initializers/rack_attack_spec.rb rename to spec/config/initializers/rack/attack_spec.rb diff --git a/spec/controllers/well_known/nodeinfo_controller_spec.rb b/spec/controllers/well_known/node_info_controller_spec.rb similarity index 100% rename from spec/controllers/well_known/nodeinfo_controller_spec.rb rename to spec/controllers/well_known/node_info_controller_spec.rb diff --git a/spec/helpers/jsonld_helper_spec.rb b/spec/helpers/json_ld_helper_spec.rb similarity index 100% rename from spec/helpers/jsonld_helper_spec.rb rename to spec/helpers/json_ld_helper_spec.rb diff --git a/spec/lib/sanitize_config_spec.rb b/spec/lib/sanitize/config_spec.rb similarity index 100% rename from spec/lib/sanitize_config_spec.rb rename to spec/lib/sanitize/config_spec.rb