From 68a92c81bfb1bc4703cd4974321b8cb168793541 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 16 Feb 2023 01:33:50 -0500 Subject: Generate minimimal Rubocop Todo file (#23629) --- .rubocop.yml | 418 ++++------------------------------------------------------- 1 file changed, 26 insertions(+), 392 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 3c9223470..5278ee38c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,9 @@ +inherit_from: .rubocop_todo.yml + +inherit_mode: + merge: + - Exclude + require: - rubocop-rails - rubocop-rspec @@ -23,50 +29,19 @@ AllCops: - 'lib/json_ld/*' - 'lib/templates/**/*' -Bundler/OrderedGems: - Enabled: false - -Layout/AccessModifierIndentation: - EnforcedStyle: indent - -Layout/EmptyLineAfterMagicComment: - Enabled: false - -Layout/EmptyLineAfterGuardClause: - Enabled: false - -Layout/EmptyLineBetweenDefs: - AllowAdjacentOneLineDefs: true - -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: true - Layout/FirstHashElementIndentation: EnforcedStyle: consistent -Layout/HashAlignment: - Enabled: false - -Layout/SpaceAroundMethodCallOperator: - Enabled: true - -Layout/SpaceInsideHashLiteralBraces: - EnforcedStyle: space - -Lint/DeprecatedOpenSSLConstant: - Enabled: true - -Lint/DuplicateElsifCondition: - Enabled: true - -Lint/MixedRegexpCaptureTypes: - Enabled: true - -Lint/RaiseException: - Enabled: true - -Lint/StructNewOverride: - Enabled: true +Layout/LineLength: + Max: 140 # RuboCop default 120 + AllowedPatterns: + # Allow comments to be long lines + - !ruby/regexp / \# .*$/ + - !ruby/regexp /^\# .*$/ + Exclude: + - lib/**/*cli*.rb + - db/*migrate/**/* + - db/seeds/**/* Lint/UselessAccessModifier: ContextCreatingMethods: @@ -77,403 +52,62 @@ Metrics/AbcSize: Exclude: - 'lib/**/*cli*.rb' - db/*migrate/**/* - - lib/paperclip/color_extractor.rb - - app/workers/scheduler/follow_recommendations_scheduler.rb - - app/services/activitypub/fetch*_service.rb - - lib/paperclip/**/* - CountRepeatedAttributes: false - AllowedMethods: - - update_media_attachments! - - account_link_to - - attempt_oembed - - build_crutches - - calculate_scores - - cc - - dump_actor! - - filter_from_home? - - hydrate - - import_bookmarks! - - import_relationships! - - initialize - - link_to_mention - - log_target - - matches_time_window? - - parse_metadata - - perform_statuses_search! - - privatize_media_attachments! - - process_update - - publish_media_attachments! - - remotable_attachment - - render_initial_state - - render_with_cache - - searchable_by - - self.cached_filters_for - - set_fetchable_attributes! - - signed_request_actor - - statuses_to_delete - - update_poll! Metrics/BlockLength: - Max: 55 + Max: 55 # Default 25 + CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' - CountComments: false - CountAsOne: [array, heredoc] - AllowedMethods: - - task - - namespace - - class_methods - - included Metrics/BlockNesting: - Max: 3 Exclude: - 'lib/mastodon/*_cli.rb' Metrics/ClassLength: - CountComments: false - Max: 500 + Max: 500 # Default 100 CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' Metrics/CyclomaticComplexity: - Max: 12 + Max: 12 # Default 7 Exclude: - lib/mastodon/*cli*.rb - db/*migrate/**/* - AllowedMethods: - - attempt_oembed - - blocked? - - build_crutches - - calculate_scores - - cc - - discover_endpoint! - - filter_from_home? - - hydrate - - klass - - link_to_mention - - log_target - - matches_time_window? - - patch_for_forwarding! - - preprocess_attributes! - - process_update - - remotable_attachment - - scan_text! - - self.cached_filters_for - - set_fetchable_attributes! - - setup_redis_env_url - - update_media_attachments! - -Layout/LineLength: - Max: 140 # RuboCop default 120 - AllowHeredoc: true - AllowURI: true - IgnoreCopDirectives: true - AllowedPatterns: - # Allow comments to be long lines - - !ruby/regexp / \# .*$/ - - !ruby/regexp /^\# .*$/ - Exclude: - - lib/**/*cli*.rb - - db/*migrate/**/* - - db/seeds/**/* Metrics/MethodLength: - CountComments: false - CountAsOne: [array, heredoc] Max: 25 # RuboCop default 10 + CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' - AllowedMethods: - - account_link_to - - attempt_oembed - - body_with_limit - - build_crutches - - cached_filters_for - - calculate_scores - - check_webfinger! - - clean_feeds! - - collection_items - - collection_presenter - - copy_account_notes! - - deduplicate_accounts! - - deduplicate_conversations! - - deduplicate_local_accounts! - - deduplicate_statuses! - - deduplicate_tags! - - deduplicate_users! - - discover_endpoint! - - extract_extra_uris_with_indices - - extract_hashtags_with_indices - - extract_mentions_or_lists_with_indices - - filter_from_home? - - from_elasticsearch - - handle_explicit_update! - - handle_mark_as_sensitive! - - hsl_to_rgb - - import_bookmarks! - - import_domain_blocks! - - import_relationships! - - ldap_options - - matches_time_window? - - outbox_presenter - - pam_get_user - - parallelize_with_progress - - parse_and_transform - - patch_for_forwarding! - - populate_home - - post_process_style - - preload_cache_collection_target_statuses - - privatize_media_attachments! - - provides_callback_for - - publish_media_attachments! - - relevant_account_timestamp - - remotable_attachment - - rgb_to_hsl - - rss_status_content_format - - set_fetchable_attributes! - - setup_redis_env_url - - signed_request_actor - - to_preview_card_attributes - - upgrade_storage_filesystem - - upgrade_storage_s3 - - user_settings_params - - hydrate - - cc - - self_destruct Metrics/ModuleLength: - CountComments: false - Max: 200 + Max: 200 # Default 100 CountAsOne: [array, heredoc] -Metrics/ParameterLists: - Max: 5 # RuboCop default 5 - CountKeywordArgs: true # RuboCop default true - MaxOptionalParameters: 3 # RuboCop default 3 - Exclude: - - app/models/concerns/account_interactions.rb - - app/services/activitypub/fetch_remote_account_service.rb - - app/services/activitypub/fetch_remote_actor_service.rb - Metrics/PerceivedComplexity: Max: 16 # RuboCop default 8 - AllowedMethods: - - attempt_oembed - - build_crutches - - calculate_scores - - deduplicate_users! - - discover_endpoint! - - filter_from_home? - - hydrate - - patch_for_forwarding! - - process_update - - remove_orphans - - update_media_attachments! - -Naming/MemoizedInstanceVariableName: - Enabled: false - -Naming/MethodParameterName: - Enabled: true - -Rails: - Enabled: true - -Rails/ApplicationController: - Enabled: false - Exclude: - - 'app/controllers/well_known/**/*.rb' - -Rails/BelongsTo: - Enabled: false - -Rails/ContentTag: - Enabled: false - -Rails/EnumHash: - Enabled: false Rails/Exit: Exclude: - - 'lib/mastodon/*' + - 'lib/mastodon/*_cli.rb' + - 'lib/mastodon/cli_helper.rb' - 'lib/cli.rb' -Rails/FilePath: - Enabled: false - -Rails/HasAndBelongsToMany: - Enabled: false - -Rails/HasManyOrHasOneDependent: - Enabled: false - -Rails/HelperInstanceVariable: - Enabled: false - -Rails/HttpStatus: - Enabled: false - -Rails/IndexBy: - Enabled: false - -Rails/InverseOf: - Enabled: false - -Rails/LexicallyScopedActionFilter: - Enabled: false - -Rails/OutputSafety: - Enabled: true - -Rails/RakeEnvironment: - Enabled: false - -Rails/RedundantForeignKey: - Enabled: false - -Rails/SkipsModelValidations: - Enabled: false - -Rails/UniqueValidationWithoutIndex: - Enabled: false - -Style/AccessorGrouping: - Enabled: true - -Style/AccessModifierDeclarations: - Enabled: false - -Style/ArrayCoercion: - Enabled: true - -Style/BisectedAttrAccessor: - Enabled: true - -Style/CaseLikeIf: - Enabled: false - -Style/ClassAndModuleChildren: - Enabled: false - -Style/CollectionMethods: - Enabled: true - PreferredMethods: - find_all: 'select' - -Style/Documentation: - Enabled: false - -Style/DoubleNegation: - Enabled: true - -Style/ExpandPathArguments: - Enabled: false - -Style/ExponentialNotation: - Enabled: true - -Style/FormatString: - Enabled: false - -Style/FormatStringToken: - Enabled: false - -Style/FrozenStringLiteralComment: - Enabled: true - -Style/GuardClause: - Enabled: false - -Style/HashAsLastArrayItem: - Enabled: false - -Style/HashEachMethods: - Enabled: true - -Style/HashLikeCase: - Enabled: true - -Style/HashTransformKeys: - Enabled: true - -Style/HashTransformValues: +Style/Copyright: Enabled: false + AutocorrectNotice: Style/HashSyntax: - Enabled: true EnforcedStyle: ruby19_no_mixed_keys -Style/IfUnlessModifier: - Enabled: false - -Style/InverseMethods: - Enabled: false - -Style/Lambda: - Enabled: false - -Style/MutableConstant: - Enabled: false - Style/PercentLiteralDelimiters: PreferredDelimiters: '%i': '()' '%w': '()' -Style/PerlBackrefs: - AutoCorrect: false - -Style/RedundantFetchBlock: - Enabled: true - -Style/RedundantFileExtensionInRequire: - Enabled: true - -Style/RedundantRegexpCharacterClass: - Enabled: false - -Style/RedundantRegexpEscape: - Enabled: false - -Style/RedundantReturn: - Enabled: true - -Style/RedundantBegin: - Enabled: false - -Style/RegexpLiteral: - Enabled: false - -Style/RescueStandardError: - Enabled: true - -Style/SignalException: - Enabled: false - -Style/SlicingWithRange: - Enabled: true - -Style/SymbolArray: - Enabled: false - Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: 'comma' Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: 'comma' - -Style/UnpackFirst: - Enabled: false - -RSpec/ScatteredSetup: - Enabled: false -RSpec/ImplicitExpect: - Enabled: false -RSpec/NamedSubject: - Enabled: false -RSpec/DescribeClass: - Enabled: false -RSpec/LetSetup: - Enabled: false -- cgit From ac59d6f19f00f1503343cd587c4238dc0038127a Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 17 Feb 2023 21:05:57 -0500 Subject: Enable Rubocop Style/NumericLiterals (#23647) --- .rubocop.yml | 4 ++++ .rubocop_todo.yml | 10 ---------- db/migrate/20180812173710_copy_status_stats.rb | 2 +- db/migrate/20181116173541_copy_account_stats.rb | 2 +- lib/mastodon/maintenance_cli.rb | 20 ++++++++++---------- spec/controllers/api/v1/markers_controller_spec.rb | 4 ++-- 6 files changed, 18 insertions(+), 24 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 5278ee38c..eb3fcba43 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -101,6 +101,10 @@ Style/Copyright: Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys +Style/NumericLiterals: + AllowedPatterns: + - \d{4}_\d{2}_\d{2}_\d{6} # For DB migration date version number readability + Style/PercentLiteralDelimiters: PreferredDelimiters: '%i': '()' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e24ce7e32..12e4f14ec 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -3149,16 +3149,6 @@ Style/MutableConstant: - 'lib/mastodon/snowflake.rb' - 'spec/controllers/api/base_controller_spec.rb' -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MinDigits, Strict, AllowedNumbers, AllowedPatterns. -Style/NumericLiterals: - Exclude: - - 'db/migrate/20180812173710_copy_status_stats.rb' - - 'db/migrate/20181116173541_copy_account_stats.rb' - - 'lib/mastodon/maintenance_cli.rb' - - 'spec/controllers/api/v1/markers_controller_spec.rb' - # Offense count: 10 # Configuration parameters: AllowedMethods. # AllowedMethods: respond_to_missing? diff --git a/db/migrate/20180812173710_copy_status_stats.rb b/db/migrate/20180812173710_copy_status_stats.rb index ff10c18d9..9b2971beb 100644 --- a/db/migrate/20180812173710_copy_status_stats.rb +++ b/db/migrate/20180812173710_copy_status_stats.rb @@ -19,7 +19,7 @@ class CopyStatusStats < ActiveRecord::Migration[5.2] def supports_upsert? version = select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i - version >= 90500 + version >= 90_500 end def up_fast diff --git a/db/migrate/20181116173541_copy_account_stats.rb b/db/migrate/20181116173541_copy_account_stats.rb index 8e27eb11b..20dc85195 100644 --- a/db/migrate/20181116173541_copy_account_stats.rb +++ b/db/migrate/20181116173541_copy_account_stats.rb @@ -19,7 +19,7 @@ class CopyAccountStats < ActiveRecord::Migration[5.2] def supports_upsert? version = select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i - version >= 90500 + version >= 90_500 end def up_fast diff --git a/lib/mastodon/maintenance_cli.rb b/lib/mastodon/maintenance_cli.rb index 85937da81..a86a4f2f6 100644 --- a/lib/mastodon/maintenance_cli.rb +++ b/lib/mastodon/maintenance_cli.rb @@ -13,8 +13,8 @@ module Mastodon true end - MIN_SUPPORTED_VERSION = 2019_10_01_213028 # rubocop:disable Style/NumericLiterals - MAX_SUPPORTED_VERSION = 2022_11_04_133904 # rubocop:disable Style/NumericLiterals + MIN_SUPPORTED_VERSION = 2019_10_01_213028 + MAX_SUPPORTED_VERSION = 2022_11_04_133904 # Stubs to enjoy ActiveRecord queries while not depending on a particular # version of the code/database @@ -209,7 +209,7 @@ module Mastodon end @prompt.say 'Restoring index_accounts_on_username_and_domain_lower…' - if ActiveRecord::Migrator.current_version < 20200620164023 # rubocop:disable Style/NumericLiterals + if ActiveRecord::Migrator.current_version < 2020_06_20_164023 ActiveRecord::Base.connection.add_index :accounts, 'lower (username), lower(domain)', name: 'index_accounts_on_username_and_domain_lower', unique: true else ActiveRecord::Base.connection.add_index :accounts, "lower (username), COALESCE(lower(domain), '')", name: 'index_accounts_on_username_and_domain_lower', unique: true @@ -252,7 +252,7 @@ module Mastodon end end - if ActiveRecord::Migrator.current_version < 20220118183010 # rubocop:disable Style/NumericLiterals + if ActiveRecord::Migrator.current_version < 2022_01_18_183010 ActiveRecord::Base.connection.select_all("SELECT string_agg(id::text, ',') AS ids FROM users WHERE remember_token IS NOT NULL GROUP BY remember_token HAVING count(*) > 1").each do |row| users = User.where(id: row['ids'].split(',')).sort_by(&:updated_at).reverse.drop(1) @prompt.warn "Unsetting remember token for those accounts: #{users.map(&:account).map(&:acct).join(', ')}" @@ -275,9 +275,9 @@ module Mastodon @prompt.say 'Restoring users indexes…' ActiveRecord::Base.connection.add_index :users, ['confirmation_token'], name: 'index_users_on_confirmation_token', unique: true ActiveRecord::Base.connection.add_index :users, ['email'], name: 'index_users_on_email', unique: true - ActiveRecord::Base.connection.add_index :users, ['remember_token'], name: 'index_users_on_remember_token', unique: true if ActiveRecord::Migrator.current_version < 20220118183010 + ActiveRecord::Base.connection.add_index :users, ['remember_token'], name: 'index_users_on_remember_token', unique: true if ActiveRecord::Migrator.current_version < 2022_01_18_183010 - if ActiveRecord::Migrator.current_version < 20220310060641 # rubocop:disable Style/NumericLiterals + if ActiveRecord::Migrator.current_version < 2022_03_10_060641 ActiveRecord::Base.connection.add_index :users, ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true else ActiveRecord::Base.connection.add_index :users, ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true, where: 'reset_password_token IS NOT NULL', opclass: :text_pattern_ops @@ -340,7 +340,7 @@ module Mastodon end @prompt.say 'Restoring conversations indexes…' - if ActiveRecord::Migrator.current_version < 20220307083603 # rubocop:disable Style/NumericLiterals + if ActiveRecord::Migrator.current_version < 2022_03_07_083603 ActiveRecord::Base.connection.add_index :conversations, ['uri'], name: 'index_conversations_on_uri', unique: true else ActiveRecord::Base.connection.add_index :conversations, ['uri'], name: 'index_conversations_on_uri', unique: true, where: 'uri IS NOT NULL', opclass: :text_pattern_ops @@ -457,7 +457,7 @@ module Mastodon end @prompt.say 'Restoring media_attachments indexes…' - if ActiveRecord::Migrator.current_version < 20220310060626 # rubocop:disable Style/NumericLiterals + if ActiveRecord::Migrator.current_version < 2022_03_10_060626 ActiveRecord::Base.connection.add_index :media_attachments, ['shortcode'], name: 'index_media_attachments_on_shortcode', unique: true else ActiveRecord::Base.connection.add_index :media_attachments, ['shortcode'], name: 'index_media_attachments_on_shortcode', unique: true, where: 'shortcode IS NOT NULL', opclass: :text_pattern_ops @@ -490,7 +490,7 @@ module Mastodon end @prompt.say 'Restoring statuses indexes…' - if ActiveRecord::Migrator.current_version < 20220310060706 # rubocop:disable Style/NumericLiterals + if ActiveRecord::Migrator.current_version < 2022_03_10_060706 ActiveRecord::Base.connection.add_index :statuses, ['uri'], name: 'index_statuses_on_uri', unique: true else ActiveRecord::Base.connection.add_index :statuses, ['uri'], name: 'index_statuses_on_uri', unique: true, where: 'uri IS NOT NULL', opclass: :text_pattern_ops @@ -512,7 +512,7 @@ module Mastodon end @prompt.say 'Restoring tags indexes…' - if ActiveRecord::Migrator.current_version < 20210421121431 + if ActiveRecord::Migrator.current_version < 2021_04_21_121431 ActiveRecord::Base.connection.add_index :tags, 'lower((name)::text)', name: 'index_tags_on_name_lower', unique: true else ActiveRecord::Base.connection.execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower_btree ON tags (lower(name) text_pattern_ops)' diff --git a/spec/controllers/api/v1/markers_controller_spec.rb b/spec/controllers/api/v1/markers_controller_spec.rb index ba0f3c322..64ec18e59 100644 --- a/spec/controllers/api/v1/markers_controller_spec.rb +++ b/spec/controllers/api/v1/markers_controller_spec.rb @@ -42,7 +42,7 @@ RSpec.describe Api::V1::MarkersController, type: :controller do it 'creates a marker' do expect(user.markers.first.timeline).to eq 'home' - expect(user.markers.first.last_read_id).to eq 69420 + expect(user.markers.first.last_read_id).to eq 69_420 end end @@ -58,7 +58,7 @@ RSpec.describe Api::V1::MarkersController, type: :controller do it 'updates a marker' do expect(user.markers.first.timeline).to eq 'home' - expect(user.markers.first.last_read_id).to eq 70120 + expect(user.markers.first.last_read_id).to eq 70_120 end end end -- cgit From 7a941b42d399e571bce8782b7a2e31cb49214a8e Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 17 Feb 2023 21:26:41 -0500 Subject: Remove Style/Copyright Rubocop (#23665) --- .rubocop.yml | 4 ---- 1 file changed, 4 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index eb3fcba43..3783ccf48 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -94,10 +94,6 @@ Rails/Exit: - 'lib/mastodon/cli_helper.rb' - 'lib/cli.rb' -Style/Copyright: - Enabled: false - AutocorrectNotice: - Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys -- cgit From 65ba0d92ef78f82a3cf5bf04f13b3d7393da015d Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 19 Feb 2023 20:33:27 -0500 Subject: Enable Rubocop RSpec/NotToNot (#23723) --- .rubocop.yml | 3 + .rubocop_todo.yml | 123 --------------------- .../activitypub/collections_controller_spec.rb | 4 +- .../activitypub/inboxes_controller_spec.rb | 6 +- .../account_moderation_notes_controller_spec.rb | 2 +- spec/controllers/admin/accounts_controller_spec.rb | 12 +- .../admin/change_email_controller_spec.rb | 2 +- .../admin/confirmations_controller_spec.rb | 2 +- .../admin/domain_blocks_controller_spec.rb | 2 +- .../admin/report_notes_controller_spec.rb | 4 +- .../settings/profiles_controller_spec.rb | 2 +- .../well_known/nodeinfo_controller_spec.rb | 2 +- spec/lib/activitypub/activity/announce_spec.rb | 2 +- spec/lib/request_spec.rb | 2 +- spec/lib/status_filter_spec.rb | 4 +- spec/lib/text_formatter_spec.rb | 2 +- spec/models/account_spec.rb | 10 +- spec/models/concerns/account_interactions_spec.rb | 6 +- spec/models/concerns/remotable_spec.rb | 4 +- spec/models/public_feed_spec.rb | 28 ++--- spec/models/setting_spec.rb | 4 +- spec/models/tag_spec.rb | 6 +- spec/models/user_spec.rb | 4 +- spec/services/account_search_service_spec.rb | 2 +- .../activitypub/process_collection_service_spec.rb | 10 +- .../process_status_update_service_spec.rb | 4 +- spec/services/block_domain_service_spec.rb | 6 +- spec/services/clear_domain_media_service_spec.rb | 6 +- spec/services/import_service_spec.rb | 2 +- spec/services/post_status_service_spec.rb | 4 +- spec/services/search_service_spec.rb | 6 +- .../validators/blacklisted_email_validator_spec.rb | 2 +- .../disallowed_hashtags_validator_spec.rb | 4 +- spec/validators/email_mx_validator_spec.rb | 2 +- spec/validators/follow_limit_validator_spec.rb | 4 +- spec/validators/poll_validator_spec.rb | 4 +- spec/validators/status_length_validator_spec.rb | 4 +- .../unreserved_username_validator_spec.rb | 4 +- spec/validators/url_validator_spec.rb | 2 +- spec/workers/feed_insert_worker_spec.rb | 6 +- 40 files changed, 94 insertions(+), 214 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 3783ccf48..fc1969a64 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -94,6 +94,9 @@ Rails/Exit: - 'lib/mastodon/cli_helper.rb' - 'lib/cli.rb' +RSpec/NotToNot: + EnforcedStyle: to_not + Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 73ebdbfd8..9076891e2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1440,129 +1440,6 @@ RSpec/NoExpectationExample: - 'spec/controllers/auth/registrations_controller_spec.rb' - 'spec/services/precompute_feed_service_spec.rb' -# Offense count: 370 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: not_to, to_not -RSpec/NotToNot: - Exclude: - - 'spec/config/initializers/rack_attack_spec.rb' - - 'spec/controllers/accounts_controller_spec.rb' - - 'spec/controllers/admin/accounts_controller_spec.rb' - - 'spec/controllers/admin/email_domain_blocks_controller_spec.rb' - - 'spec/controllers/admin/roles_controller_spec.rb' - - 'spec/controllers/api/v1/accounts_controller_spec.rb' - - 'spec/controllers/api/v1/admin/account_actions_controller_spec.rb' - - 'spec/controllers/api/v1/admin/accounts_controller_spec.rb' - - 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb' - - 'spec/controllers/api/v1/admin/domain_blocks_controller_spec.rb' - - 'spec/controllers/api/v1/announcements/reactions_controller_spec.rb' - - 'spec/controllers/api/v1/announcements_controller_spec.rb' - - 'spec/controllers/api/v1/apps/credentials_controller_spec.rb' - - 'spec/controllers/api/v1/apps_controller_spec.rb' - - 'spec/controllers/api/v1/filters_controller_spec.rb' - - 'spec/controllers/api/v1/media_controller_spec.rb' - - 'spec/controllers/api/v1/notifications_controller_spec.rb' - - 'spec/controllers/api/v1/polls/votes_controller_spec.rb' - - 'spec/controllers/api/v1/reports_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/mutes_controller_spec.rb' - - 'spec/controllers/api/v2/filters/keywords_controller_spec.rb' - - 'spec/controllers/api/v2/filters/statuses_controller_spec.rb' - - 'spec/controllers/api/v2/filters_controller_spec.rb' - - 'spec/controllers/auth/challenges_controller_spec.rb' - - 'spec/controllers/auth/confirmations_controller_spec.rb' - - 'spec/controllers/auth/passwords_controller_spec.rb' - - 'spec/controllers/auth/registrations_controller_spec.rb' - - 'spec/controllers/concerns/challengable_concern_spec.rb' - - 'spec/controllers/oauth/authorized_applications_controller_spec.rb' - - 'spec/controllers/oauth/tokens_controller_spec.rb' - - 'spec/controllers/settings/applications_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb' - - 'spec/controllers/statuses_controller_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/lib/activitypub/activity/announce_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/dereferencer_spec.rb' - - 'spec/lib/activitypub/tag_manager_spec.rb' - - 'spec/lib/delivery_failure_tracker_spec.rb' - - 'spec/lib/feed_manager_spec.rb' - - 'spec/lib/html_aware_formatter_spec.rb' - - 'spec/lib/request_pool_spec.rb' - - 'spec/lib/status_reach_finder_spec.rb' - - 'spec/lib/vacuum/access_tokens_vacuum_spec.rb' - - 'spec/lib/vacuum/backups_vacuum_spec.rb' - - 'spec/lib/vacuum/media_attachments_vacuum_spec.rb' - - 'spec/lib/vacuum/preview_cards_vacuum_spec.rb' - - 'spec/lib/vacuum/statuses_vacuum_spec.rb' - - 'spec/lib/vacuum/system_keys_vacuum_spec.rb' - - 'spec/models/account/field_spec.rb' - - 'spec/models/account_conversation_spec.rb' - - 'spec/models/account_spec.rb' - - 'spec/models/account_statuses_cleanup_policy_spec.rb' - - 'spec/models/account_statuses_filter_spec.rb' - - 'spec/models/concerns/remotable_spec.rb' - - 'spec/models/concerns/status_threading_concern_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/media_attachment_spec.rb' - - 'spec/models/status_spec.rb' - - 'spec/models/tag_feed_spec.rb' - - 'spec/models/trends/statuses_spec.rb' - - 'spec/models/trends/tags_spec.rb' - - 'spec/models/user_spec.rb' - - 'spec/models/webhook_spec.rb' - - 'spec/policies/account_moderation_note_policy_spec.rb' - - 'spec/policies/account_policy_spec.rb' - - 'spec/policies/backup_policy_spec.rb' - - 'spec/policies/custom_emoji_policy_spec.rb' - - 'spec/policies/domain_block_policy_spec.rb' - - 'spec/policies/email_domain_block_policy_spec.rb' - - 'spec/policies/instance_policy_spec.rb' - - 'spec/policies/invite_policy_spec.rb' - - 'spec/policies/relay_policy_spec.rb' - - 'spec/policies/report_note_policy_spec.rb' - - 'spec/policies/report_policy_spec.rb' - - 'spec/policies/settings_policy_spec.rb' - - 'spec/policies/status_policy_spec.rb' - - 'spec/policies/tag_policy_spec.rb' - - 'spec/policies/user_policy_spec.rb' - - 'spec/presenters/familiar_followers_presenter_spec.rb' - - 'spec/serializers/activitypub/note_spec.rb' - - 'spec/services/account_statuses_cleanup_service_spec.rb' - - 'spec/services/activitypub/fetch_remote_status_service_spec.rb' - - 'spec/services/activitypub/process_account_service_spec.rb' - - 'spec/services/activitypub/process_status_update_service_spec.rb' - - 'spec/services/app_sign_up_service_spec.rb' - - 'spec/services/batched_remove_status_service_spec.rb' - - 'spec/services/block_domain_service_spec.rb' - - 'spec/services/bootstrap_timeline_service_spec.rb' - - 'spec/services/fan_out_on_write_service_spec.rb' - - 'spec/services/favourite_service_spec.rb' - - 'spec/services/fetch_link_card_service_spec.rb' - - 'spec/services/fetch_oembed_service_spec.rb' - - 'spec/services/fetch_remote_status_service_spec.rb' - - 'spec/services/follow_service_spec.rb' - - 'spec/services/mute_service_spec.rb' - - 'spec/services/notify_service_spec.rb' - - 'spec/services/remove_status_service_spec.rb' - - 'spec/services/report_service_spec.rb' - - 'spec/services/resolve_account_service_spec.rb' - - 'spec/services/search_service_spec.rb' - - 'spec/services/suspend_account_service_spec.rb' - - 'spec/services/unallow_domain_service_spec.rb' - - 'spec/services/unsuspend_account_service_spec.rb' - - 'spec/services/update_status_service_spec.rb' - - 'spec/support/examples/models/concerns/account_avatar.rb' - - 'spec/support/examples/models/concerns/account_header.rb' - - 'spec/validators/email_mx_validator_spec.rb' - - 'spec/validators/note_length_validator_spec.rb' - - 'spec/validators/reaction_validator_spec.rb' - - 'spec/validators/status_length_validator_spec.rb' - - 'spec/validators/unique_username_validator_spec.rb' - - 'spec/workers/activitypub/fetch_replies_worker_spec.rb' - - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' - # Offense count: 3 RSpec/PendingWithoutReason: Exclude: diff --git a/spec/controllers/activitypub/collections_controller_spec.rb b/spec/controllers/activitypub/collections_controller_spec.rb index 4e35938db..bf81cdb93 100644 --- a/spec/controllers/activitypub/collections_controller_spec.rb +++ b/spec/controllers/activitypub/collections_controller_spec.rb @@ -60,7 +60,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do end it 'does not include contents of private pinned status' do - expect(response.body).not_to include(private_pinned.text) + expect(response.body).to_not include(private_pinned.text) end context 'when account is permanently suspended' do @@ -115,7 +115,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do end it 'does not include contents of private pinned status' do - expect(response.body).not_to include(private_pinned.text) + expect(response.body).to_not include(private_pinned.text) end end diff --git a/spec/controllers/activitypub/inboxes_controller_spec.rb b/spec/controllers/activitypub/inboxes_controller_spec.rb index 2f023197b..7f4d6b2d3 100644 --- a/spec/controllers/activitypub/inboxes_controller_spec.rb +++ b/spec/controllers/activitypub/inboxes_controller_spec.rb @@ -68,7 +68,7 @@ RSpec.describe ActivityPub::InboxesController, type: :controller do let(:synchronization_collection) { 'https://example.com/followers2' } it 'does not start a synchronization job' do - expect(ActivityPub::FollowersSynchronizationWorker).not_to have_received(:perform_async) + expect(ActivityPub::FollowersSynchronizationWorker).to_not have_received(:perform_async) end end @@ -76,13 +76,13 @@ RSpec.describe ActivityPub::InboxesController, type: :controller do let(:synchronization_url) { 'https://example.org/followers' } it 'does not start a synchronization job' do - expect(ActivityPub::FollowersSynchronizationWorker).not_to have_received(:perform_async) + expect(ActivityPub::FollowersSynchronizationWorker).to_not have_received(:perform_async) end end context 'with matching digest' do it 'does not start a synchronization job' do - expect(ActivityPub::FollowersSynchronizationWorker).not_to have_received(:perform_async) + expect(ActivityPub::FollowersSynchronizationWorker).to_not have_received(:perform_async) end end diff --git a/spec/controllers/admin/account_moderation_notes_controller_spec.rb b/spec/controllers/admin/account_moderation_notes_controller_spec.rb index d3f3263f8..b8d606322 100644 --- a/spec/controllers/admin/account_moderation_notes_controller_spec.rb +++ b/spec/controllers/admin/account_moderation_notes_controller_spec.rb @@ -26,7 +26,7 @@ RSpec.describe Admin::AccountModerationNotesController, type: :controller do let(:params) { { account_moderation_note: { target_account_id: target_account.id, content: '' } } } it 'falls to create a note' do - expect { subject }.not_to change { AccountModerationNote.count } + expect { subject }.to_not change { AccountModerationNote.count } expect(subject).to render_template 'admin/accounts/show' end end diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index 48204b7b6..35d79740a 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -84,7 +84,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'fails to memorialize account' do is_expected.to have_http_status :forbidden - expect(account.reload).not_to be_memorial + expect(account.reload).to_not be_memorial end end @@ -106,7 +106,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'fails to memorialize account' do is_expected.to have_http_status :forbidden - expect(account.reload).not_to be_memorial + expect(account.reload).to_not be_memorial end end @@ -115,7 +115,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'fails to memorialize account' do is_expected.to have_http_status :forbidden - expect(account.reload).not_to be_memorial + expect(account.reload).to_not be_memorial end end end @@ -133,7 +133,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'succeeds in enabling account' do is_expected.to redirect_to admin_account_path(account.id) - expect(user.reload).not_to be_disabled + expect(user.reload).to_not be_disabled end end @@ -183,7 +183,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'fails to approve account' do is_expected.to have_http_status :forbidden - expect(user.reload).not_to be_approved + expect(user.reload).to_not be_approved end end end @@ -223,7 +223,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'fails to reject account' do is_expected.to have_http_status :forbidden - expect(user.reload).not_to be_approved + expect(user.reload).to_not be_approved end end end diff --git a/spec/controllers/admin/change_email_controller_spec.rb b/spec/controllers/admin/change_email_controller_spec.rb index 0814f327d..520842a19 100644 --- a/spec/controllers/admin/change_email_controller_spec.rb +++ b/spec/controllers/admin/change_email_controller_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Admin::ChangeEmailsController, type: :controller do expect(user.email).to eq previous_email expect(user.unconfirmed_email).to eq 'test@example.com' - expect(user.confirmation_token).not_to be_nil + expect(user.confirmation_token).to_not be_nil expect(UserMailer).to have_received(:confirmation_instructions).with(user, user.confirmation_token, { to: 'test@example.com' }) diff --git a/spec/controllers/admin/confirmations_controller_spec.rb b/spec/controllers/admin/confirmations_controller_spec.rb index 6268903c4..7ca90f3e1 100644 --- a/spec/controllers/admin/confirmations_controller_spec.rb +++ b/spec/controllers/admin/confirmations_controller_spec.rb @@ -55,7 +55,7 @@ RSpec.describe Admin::ConfirmationsController, type: :controller do it 'does not resend confirmation mail' do expect(subject).to redirect_to admin_accounts_path expect(flash[:error]).to eq I18n.t('admin.accounts.resend_confirmation.already_confirmed') - expect(UserMailer).not_to have_received(:confirmation_instructions) + expect(UserMailer).to_not have_received(:confirmation_instructions) end end end diff --git a/spec/controllers/admin/domain_blocks_controller_spec.rb b/spec/controllers/admin/domain_blocks_controller_spec.rb index 3b2fd6c5d..92fc19efa 100644 --- a/spec/controllers/admin/domain_blocks_controller_spec.rb +++ b/spec/controllers/admin/domain_blocks_controller_spec.rb @@ -54,7 +54,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do post :create, params: { domain_block: { domain: 'example.com', severity: 'silence' } } - expect(DomainBlockWorker).not_to have_received(:perform_async) + expect(DomainBlockWorker).to_not have_received(:perform_async) expect(response).to render_template :new end diff --git a/spec/controllers/admin/report_notes_controller_spec.rb b/spec/controllers/admin/report_notes_controller_spec.rb index fa7572d18..8a2603611 100644 --- a/spec/controllers/admin/report_notes_controller_spec.rb +++ b/spec/controllers/admin/report_notes_controller_spec.rb @@ -34,7 +34,7 @@ describe Admin::ReportNotesController do it 'creates a report note and does not resolve report' do expect { subject }.to change { ReportNote.count }.by(1) - expect(report.reload).not_to be_action_taken + expect(report.reload).to_not be_action_taken expect(subject).to redirect_to admin_report_path(report) end end @@ -49,7 +49,7 @@ describe Admin::ReportNotesController do it 'creates a report note and unresolves report' do expect { subject }.to change { ReportNote.count }.by(1) - expect(report.reload).not_to be_action_taken + expect(report.reload).to_not be_action_taken expect(subject).to redirect_to admin_report_path(report) end end diff --git a/spec/controllers/settings/profiles_controller_spec.rb b/spec/controllers/settings/profiles_controller_spec.rb index fbbca8bb9..c7a6ad664 100644 --- a/spec/controllers/settings/profiles_controller_spec.rb +++ b/spec/controllers/settings/profiles_controller_spec.rb @@ -38,7 +38,7 @@ RSpec.describe Settings::ProfilesController, type: :controller do put :update, params: { account: { avatar: fixture_file_upload('avatar.gif', 'image/gif') } } expect(response).to redirect_to(settings_profile_path) - expect(account.reload.avatar.instance.avatar_file_name).not_to be_nil + expect(account.reload.avatar.instance.avatar_file_name).to_not be_nil expect(ActivityPub::UpdateDistributionWorker).to have_received(:perform_async).with(account.id) end end diff --git a/spec/controllers/well_known/nodeinfo_controller_spec.rb b/spec/controllers/well_known/nodeinfo_controller_spec.rb index 964a14706..e9436cd26 100644 --- a/spec/controllers/well_known/nodeinfo_controller_spec.rb +++ b/spec/controllers/well_known/nodeinfo_controller_spec.rb @@ -27,7 +27,7 @@ describe WellKnown::NodeInfoController, type: :controller do json = body_as_json - expect({ 'foo' => 0 }).not_to match_json_schema('nodeinfo_2.0') + expect({ 'foo' => 0 }).to_not match_json_schema('nodeinfo_2.0') expect(json).to match_json_schema('nodeinfo_2.0') expect(json[:version]).to eq '2.0' expect(json[:usage]).to be_a Hash diff --git a/spec/lib/activitypub/activity/announce_spec.rb b/spec/lib/activitypub/activity/announce_spec.rb index 461c3757b..adb13acc2 100644 --- a/spec/lib/activitypub/activity/announce_spec.rb +++ b/spec/lib/activitypub/activity/announce_spec.rb @@ -139,7 +139,7 @@ RSpec.describe ActivityPub::Activity::Announce do end it 'does not fetch the remote status' do - expect(a_request(:get, 'https://example.com/actor/hello-world')).not_to have_been_made + expect(a_request(:get, 'https://example.com/actor/hello-world')).to_not have_been_made expect(Status.find_by(uri: 'https://example.com/actor/hello-world')).to be_nil end diff --git a/spec/lib/request_spec.rb b/spec/lib/request_spec.rb index e555a8b5a..f63a836de 100644 --- a/spec/lib/request_spec.rb +++ b/spec/lib/request_spec.rb @@ -102,7 +102,7 @@ describe Request do it 'accepts body less than 1 megabyte by default' do stub_request(:any, 'http://example.com').to_return(body: SecureRandom.random_bytes(2.kilobytes)) - expect { subject.perform { |response| response.body_with_limit } }.not_to raise_error + expect { subject.perform { |response| response.body_with_limit } }.to_not raise_error end it 'rejects body by given size' do diff --git a/spec/lib/status_filter_spec.rb b/spec/lib/status_filter_spec.rb index 287fe00de..cdb482059 100644 --- a/spec/lib/status_filter_spec.rb +++ b/spec/lib/status_filter_spec.rb @@ -10,7 +10,7 @@ describe StatusFilter do subject { described_class.new(status, nil) } context 'when there are no connections' do - it { is_expected.not_to be_filtered } + it { is_expected.to_not be_filtered } end context 'when status account is silenced' do @@ -36,7 +36,7 @@ describe StatusFilter do subject { described_class.new(status, account) } context 'when there are no connections' do - it { is_expected.not_to be_filtered } + it { is_expected.to_not be_filtered } end context 'when status account is blocked' do diff --git a/spec/lib/text_formatter_spec.rb b/spec/lib/text_formatter_spec.rb index d4a3a6b59..cc742b65e 100644 --- a/spec/lib/text_formatter_spec.rb +++ b/spec/lib/text_formatter_spec.rb @@ -18,7 +18,7 @@ RSpec.describe TextFormatter do let(:text) { "line\nfeed" } it 'removes line feeds' do - is_expected.not_to include "\n" + is_expected.to_not include "\n" end end diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 763835618..03ed12d78 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -31,7 +31,7 @@ RSpec.describe Account, type: :model do end it 'does not raise an error' do - expect { subject.suspend! }.not_to raise_error + expect { subject.suspend! }.to_not raise_error end end end @@ -206,7 +206,7 @@ RSpec.describe Account, type: :model do end it 'calls not ResolveAccountService#call' do - expect_any_instance_of(ResolveAccountService).not_to receive(:call).with(acct) + expect_any_instance_of(ResolveAccountService).to_not receive(:call).with(acct) account.refresh! end end @@ -811,19 +811,19 @@ RSpec.describe Account, type: :model do it 'is valid even if the username is longer than 30 characters' do account = Fabricate.build(:account, domain: 'domain', username: Faker::Lorem.characters(number: 31)) account.valid? - expect(account).not_to model_have_error_on_field(:username) + expect(account).to_not model_have_error_on_field(:username) end it 'is valid even if the display name is longer than 30 characters' do account = Fabricate.build(:account, domain: 'domain', display_name: Faker::Lorem.characters(number: 31)) account.valid? - expect(account).not_to model_have_error_on_field(:display_name) + expect(account).to_not model_have_error_on_field(:display_name) end it 'is valid even if the note is longer than 500 characters' do account = Fabricate.build(:account, domain: 'domain', note: Faker::Lorem.characters(number: 501)) account.valid? - expect(account).not_to model_have_error_on_field(:note) + expect(account).to_not model_have_error_on_field(:note) end end end diff --git a/spec/models/concerns/account_interactions_spec.rb b/spec/models/concerns/account_interactions_spec.rb index b79c44594..b2d84308b 100644 --- a/spec/models/concerns/account_interactions_spec.rb +++ b/spec/models/concerns/account_interactions_spec.rb @@ -163,7 +163,7 @@ describe AccountInteractions do it 'returns Mute without updating mute.hide_notifications' do expect do expect(subject).to be_a Mute - end.not_to change { mute.reload.hide_notifications? }.from(true) + end.to_not change { mute.reload.hide_notifications? }.from(true) end end @@ -183,7 +183,7 @@ describe AccountInteractions do it 'returns Mute without updating mute.hide_notifications' do expect do expect(subject).to be_a Mute - end.not_to change { mute.reload.hide_notifications? }.from(true) + end.to_not change { mute.reload.hide_notifications? }.from(true) end end end @@ -207,7 +207,7 @@ describe AccountInteractions do it 'returns Mute without updating mute.hide_notifications' do expect do expect(subject).to be_a Mute - end.not_to change { mute.reload.hide_notifications? }.from(false) + end.to_not change { mute.reload.hide_notifications? }.from(false) end end diff --git a/spec/models/concerns/remotable_spec.rb b/spec/models/concerns/remotable_spec.rb index ca2d65d2d..964520427 100644 --- a/spec/models/concerns/remotable_spec.rb +++ b/spec/models/concerns/remotable_spec.rb @@ -147,8 +147,8 @@ RSpec.describe Remotable do let(:code) { 500 } it 'does not assign file' do - expect(foo).not_to receive(:public_send).with("#{hoge}=", any_args) - expect(foo).not_to receive(:public_send).with("#{hoge}_file_name=", any_args) + expect(foo).to_not receive(:public_send).with("#{hoge}=", any_args) + expect(foo).to_not receive(:public_send).with("#{hoge}_file_name=", any_args) foo.hoge_remote_url = url end diff --git a/spec/models/public_feed_spec.rb b/spec/models/public_feed_spec.rb index 0ffc343f1..be46639c5 100644 --- a/spec/models/public_feed_spec.rb +++ b/spec/models/public_feed_spec.rb @@ -11,7 +11,7 @@ RSpec.describe PublicFeed, type: :model do private_status = Fabricate(:status, visibility: :private) expect(subject).to include(public_status.id) - expect(subject).not_to include(private_status.id) + expect(subject).to_not include(private_status.id) end it 'does not include replies' do @@ -19,7 +19,7 @@ RSpec.describe PublicFeed, type: :model do reply = Fabricate(:status, in_reply_to_id: status.id) expect(subject).to include(status.id) - expect(subject).not_to include(reply.id) + expect(subject).to_not include(reply.id) end it 'does not include boosts' do @@ -27,7 +27,7 @@ RSpec.describe PublicFeed, type: :model do boost = Fabricate(:status, reblog_of_id: status.id) expect(subject).to include(status.id) - expect(subject).not_to include(boost.id) + expect(subject).to_not include(boost.id) end it 'filters out silenced accounts' do @@ -36,7 +36,7 @@ RSpec.describe PublicFeed, type: :model do silenced_status = Fabricate(:status, account: silenced_account) expect(subject).to include(status.id) - expect(subject).not_to include(silenced_status.id) + expect(subject).to_not include(silenced_status.id) end context 'without local_only option' do @@ -87,7 +87,7 @@ RSpec.describe PublicFeed, type: :model do it 'does not include remote instances statuses' do expect(subject).to include(local_status.id) - expect(subject).not_to include(remote_status.id) + expect(subject).to_not include(remote_status.id) end end @@ -96,13 +96,13 @@ RSpec.describe PublicFeed, type: :model do it 'does not include remote instances statuses' do expect(subject).to include(local_status.id) - expect(subject).not_to include(remote_status.id) + expect(subject).to_not include(remote_status.id) end it 'is not affected by personal domain blocks' do viewer.block_domain!('test.com') expect(subject).to include(local_status.id) - expect(subject).not_to include(remote_status.id) + expect(subject).to_not include(remote_status.id) end end end @@ -119,7 +119,7 @@ RSpec.describe PublicFeed, type: :model do let(:viewer) { nil } it 'does not include local instances statuses' do - expect(subject).not_to include(local_status.id) + expect(subject).to_not include(local_status.id) expect(subject).to include(remote_status.id) end end @@ -128,7 +128,7 @@ RSpec.describe PublicFeed, type: :model do let(:viewer) { Fabricate(:account, username: 'viewer') } it 'does not include local instances statuses' do - expect(subject).not_to include(local_status.id) + expect(subject).to_not include(local_status.id) expect(subject).to include(remote_status.id) end end @@ -146,7 +146,7 @@ RSpec.describe PublicFeed, type: :model do @account.block!(blocked) blocked_status = Fabricate(:status, account: blocked) - expect(subject).not_to include(blocked_status.id) + expect(subject).to_not include(blocked_status.id) end it 'excludes statuses from accounts who have blocked the account' do @@ -154,7 +154,7 @@ RSpec.describe PublicFeed, type: :model do blocker.block!(@account) blocked_status = Fabricate(:status, account: blocker) - expect(subject).not_to include(blocked_status.id) + expect(subject).to_not include(blocked_status.id) end it 'excludes statuses from accounts muted by the account' do @@ -162,7 +162,7 @@ RSpec.describe PublicFeed, type: :model do @account.mute!(muted) muted_status = Fabricate(:status, account: muted) - expect(subject).not_to include(muted_status.id) + expect(subject).to_not include(muted_status.id) end it 'excludes statuses from accounts from personally blocked domains' do @@ -170,7 +170,7 @@ RSpec.describe PublicFeed, type: :model do @account.block_domain!(blocked.domain) blocked_status = Fabricate(:status, account: blocked) - expect(subject).not_to include(blocked_status.id) + expect(subject).to_not include(blocked_status.id) end context 'with language preferences' do @@ -182,7 +182,7 @@ RSpec.describe PublicFeed, type: :model do expect(subject).to include(en_status.id) expect(subject).to include(es_status.id) - expect(subject).not_to include(fr_status.id) + expect(subject).to_not include(fr_status.id) end it 'includes all languages when user does not have a setting' do diff --git a/spec/models/setting_spec.rb b/spec/models/setting_spec.rb index 83ba415a8..077223094 100644 --- a/spec/models/setting_spec.rb +++ b/spec/models/setting_spec.rb @@ -38,7 +38,7 @@ RSpec.describe Setting, type: :model do let(:cache_value) { 'cache-value' } it 'calls not RailsSettings::Base#[]' do - expect(RailsSettings::Base).not_to receive(:[]).with(key) + expect(RailsSettings::Base).to_not receive(:[]).with(key) described_class[key] end @@ -104,7 +104,7 @@ RSpec.describe Setting, type: :model do ActiveSupport::Notifications.subscribed callback, 'sql.active_record' do described_class[key] end - expect(callback).not_to have_received(:call) + expect(callback).to_not have_received(:call) end it 'returns the cached value' do diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb index 102d2f625..7043449c5 100644 --- a/spec/models/tag_spec.rb +++ b/spec/models/tag_spec.rb @@ -4,15 +4,15 @@ require 'rails_helper' RSpec.describe Tag do describe 'validations' do it 'invalid with #' do - expect(described_class.new(name: '#hello_world')).not_to be_valid + expect(described_class.new(name: '#hello_world')).to_not be_valid end it 'invalid with .' do - expect(described_class.new(name: '.abcdef123')).not_to be_valid + expect(described_class.new(name: '.abcdef123')).to_not be_valid end it 'invalid with spaces' do - expect(described_class.new(name: 'hello world')).not_to be_valid + expect(described_class.new(name: 'hello world')).to_not be_valid end it 'valid with aesthetic' do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index dde1503c0..c2f7e99ac 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -159,7 +159,7 @@ RSpec.describe User, type: :model do it 'does not trigger the account.approved Web Hook' do subject - expect(TriggerWebhookWorker).not_to have_received(:perform_async).with('account.approved', 'Account', user.account_id) + expect(TriggerWebhookWorker).to_not have_received(:perform_async).with('account.approved', 'Account', user.account_id) end end @@ -270,7 +270,7 @@ RSpec.describe User, type: :model do it 'does not trigger the account.approved Web Hook' do subject - expect(TriggerWebhookWorker).not_to have_received(:perform_async).with('account.approved', 'Account', user.account_id) + expect(TriggerWebhookWorker).to_not have_received(:perform_async).with('account.approved', 'Account', user.account_id) end end end diff --git a/spec/services/account_search_service_spec.rb b/spec/services/account_search_service_spec.rb index d3b5baad6..45e19d1ef 100644 --- a/spec/services/account_search_service_spec.rb +++ b/spec/services/account_search_service_spec.rb @@ -63,7 +63,7 @@ describe AccountSearchService, type: :service do allow(ResolveAccountService).to receive(:new).and_return(service) results = subject.call('newuser@remote.com', nil, limit: 10, resolve: false) - expect(service).not_to have_received(:call) + expect(service).to_not have_received(:call) end end diff --git a/spec/services/activitypub/process_collection_service_spec.rb b/spec/services/activitypub/process_collection_service_spec.rb index fbfa6d6c6..d35d9596d 100644 --- a/spec/services/activitypub/process_collection_service_spec.rb +++ b/spec/services/activitypub/process_collection_service_spec.rb @@ -39,7 +39,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do end it 'does not process payload' do - expect(ActivityPub::Activity).not_to receive(:factory) + expect(ActivityPub::Activity).to_not receive(:factory) subject.call(json, actor) end end @@ -69,7 +69,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do it 'does not process payload if no signature exists' do expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil) - expect(ActivityPub::Activity).not_to receive(:factory) + expect(ActivityPub::Activity).to_not receive(:factory) subject.call(json, forwarder) end @@ -87,7 +87,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do payload['signature'] = { 'type' => 'RsaSignature2017' } expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil) - expect(ActivityPub::Activity).not_to receive(:factory) + expect(ActivityPub::Activity).to_not receive(:factory) subject.call(json, forwarder) end @@ -206,7 +206,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do end it 'does not process forged payload' do - expect(ActivityPub::Activity).not_to receive(:factory).with( + expect(ActivityPub::Activity).to_not receive(:factory).with( hash_including( 'object' => hash_including( 'id' => 'https://example.com/users/bob/fake-status' @@ -216,7 +216,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do anything ) - expect(ActivityPub::Activity).not_to receive(:factory).with( + expect(ActivityPub::Activity).to_not receive(:factory).with( hash_including( 'object' => hash_including( 'content' => '

puck was here

' diff --git a/spec/services/activitypub/process_status_update_service_spec.rb b/spec/services/activitypub/process_status_update_service_spec.rb index 5d15f6ffe..ae7db88bf 100644 --- a/spec/services/activitypub/process_status_update_service_spec.rb +++ b/spec/services/activitypub/process_status_update_service_spec.rb @@ -214,11 +214,11 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do end it 'does not create any edits' do - expect { subject.call(status, json) }.not_to change { status.reload.edits.pluck(&:id) } + expect { subject.call(status, json) }.to_not change { status.reload.edits.pluck(&:id) } end it 'does not update the text, spoiler_text or edited_at' do - expect { subject.call(status, json) }.not_to change { s = status.reload; [s.text, s.spoiler_text, s.edited_at] } + expect { subject.call(status, json) }.to_not change { s = status.reload; [s.text, s.spoiler_text, s.edited_at] } end end diff --git a/spec/services/block_domain_service_spec.rb b/spec/services/block_domain_service_spec.rb index 242b02fff..e24e48d41 100644 --- a/spec/services/block_domain_service_spec.rb +++ b/spec/services/block_domain_service_spec.rb @@ -67,9 +67,9 @@ RSpec.describe BlockDomainService, type: :service do end it 'leaves the domains status and attachments, but clears media' do - expect { bad_status1.reload }.not_to raise_error - expect { bad_status2.reload }.not_to raise_error - expect { bad_attachment.reload }.not_to raise_error + expect { bad_status1.reload }.to_not raise_error + expect { bad_status2.reload }.to_not raise_error + expect { bad_attachment.reload }.to_not raise_error expect(bad_attachment.file.exists?).to be false end end diff --git a/spec/services/clear_domain_media_service_spec.rb b/spec/services/clear_domain_media_service_spec.rb index 45b92e2c9..e90faf84d 100644 --- a/spec/services/clear_domain_media_service_spec.rb +++ b/spec/services/clear_domain_media_service_spec.rb @@ -14,9 +14,9 @@ RSpec.describe ClearDomainMediaService, type: :service do end it 'leaves the domains status and attachments, but clears media' do - expect { bad_status1.reload }.not_to raise_error - expect { bad_status2.reload }.not_to raise_error - expect { bad_attachment.reload }.not_to raise_error + expect { bad_status1.reload }.to_not raise_error + expect { bad_status2.reload }.to_not raise_error + expect { bad_attachment.reload }.to_not raise_error expect(bad_attachment.file.exists?).to be false end end diff --git a/spec/services/import_service_spec.rb b/spec/services/import_service_spec.rb index a12148833..2b1516ff0 100644 --- a/spec/services/import_service_spec.rb +++ b/spec/services/import_service_spec.rb @@ -234,7 +234,7 @@ RSpec.describe ImportService, type: :service do subject.call(import) expect(account.bookmarks.map(&:status).map(&:id)).to include(local_status.id) expect(account.bookmarks.map(&:status).map(&:id)).to include(remote_status.id) - expect(account.bookmarks.map(&:status).map(&:id)).not_to include(direct_status.id) + expect(account.bookmarks.map(&:status).map(&:id)).to_not include(direct_status.id) expect(account.bookmarks.count).to eq 3 end end diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index 0b72253a5..2148f1819 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -50,7 +50,7 @@ RSpec.describe PostStatusService, type: :service do end it 'does not change statuses count' do - expect { subject.call(account, text: 'Hi future!', scheduled_at: future, thread: previous_status) }.not_to change { [account.statuses_count, previous_status.replies_count] } + expect { subject.call(account, text: 'Hi future!', scheduled_at: future, thread: previous_status) }.to_not change { [account.statuses_count, previous_status.replies_count] } end end @@ -157,7 +157,7 @@ RSpec.describe PostStatusService, type: :service do expect do subject.call(account, text: '@alice @alice @alice hey @alice') - end.not_to raise_error + end.to_not raise_error end it 'processes hashtags' do diff --git a/spec/services/search_service_spec.rb b/spec/services/search_service_spec.rb index 6f32007e8..7ec334a56 100644 --- a/spec/services/search_service_spec.rb +++ b/spec/services/search_service_spec.rb @@ -13,8 +13,8 @@ describe SearchService, type: :service do results = subject.call('', nil, 10) expect(results).to eq(empty_results) - expect(AccountSearchService).not_to have_received(:new) - expect(Tag).not_to have_received(:search_for) + expect(AccountSearchService).to_not have_received(:new) + expect(Tag).to_not have_received(:search_for) end end @@ -89,7 +89,7 @@ describe SearchService, type: :service do allow(Tag).to receive(:search_for) results = subject.call(query, nil, 10) - expect(Tag).not_to have_received(:search_for) + expect(Tag).to_not have_received(:search_for) expect(results).to eq empty_results end diff --git a/spec/validators/blacklisted_email_validator_spec.rb b/spec/validators/blacklisted_email_validator_spec.rb index f9ee3b932..cb807fe24 100644 --- a/spec/validators/blacklisted_email_validator_spec.rb +++ b/spec/validators/blacklisted_email_validator_spec.rb @@ -26,7 +26,7 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do let(:blocked_email) { false } it 'does not add errors' do - expect(subject).not_to have_received(:add).with(:email, :blocked) + expect(subject).to_not have_received(:add).with(:email, :blocked) end context 'when canonical e-mail is blocked' do diff --git a/spec/validators/disallowed_hashtags_validator_spec.rb b/spec/validators/disallowed_hashtags_validator_spec.rb index 9deec0bb9..2c4ebc4f2 100644 --- a/spec/validators/disallowed_hashtags_validator_spec.rb +++ b/spec/validators/disallowed_hashtags_validator_spec.rb @@ -19,7 +19,7 @@ RSpec.describe DisallowedHashtagsValidator, type: :validator do let(:reblog) { true } it 'does not add errors' do - expect(errors).not_to have_received(:add).with(:text, any_args) + expect(errors).to_not have_received(:add).with(:text, any_args) end end @@ -31,7 +31,7 @@ RSpec.describe DisallowedHashtagsValidator, type: :validator do let(:disallowed_tags) { [] } it 'does not add errors' do - expect(errors).not_to have_received(:add).with(:text, any_args) + expect(errors).to_not have_received(:add).with(:text, any_args) end end diff --git a/spec/validators/email_mx_validator_spec.rb b/spec/validators/email_mx_validator_spec.rb index 6640d6058..ffb6851d0 100644 --- a/spec/validators/email_mx_validator_spec.rb +++ b/spec/validators/email_mx_validator_spec.rb @@ -38,7 +38,7 @@ describe EmailMxValidator do allow(Resolv::DNS).to receive(:open).and_yield(resolver) subject.validate(user) - expect(user.errors).not_to have_received(:add) + expect(user.errors).to_not have_received(:add) end it 'adds an error if the email domain name contains empty labels' do diff --git a/spec/validators/follow_limit_validator_spec.rb b/spec/validators/follow_limit_validator_spec.rb index cc8fbb631..94ba0c47f 100644 --- a/spec/validators/follow_limit_validator_spec.rb +++ b/spec/validators/follow_limit_validator_spec.rb @@ -22,7 +22,7 @@ RSpec.describe FollowLimitValidator, type: :validator do let(:_nil) { true } it 'not calls errors.add' do - expect(errors).not_to have_received(:add).with(:base, any_args) + expect(errors).to_not have_received(:add).with(:base, any_args) end end @@ -43,7 +43,7 @@ RSpec.describe FollowLimitValidator, type: :validator do let(:limit_reached) { false } it 'not calls errors.add' do - expect(errors).not_to have_received(:add).with(:base, any_args) + expect(errors).to_not have_received(:add).with(:base, any_args) end end end diff --git a/spec/validators/poll_validator_spec.rb b/spec/validators/poll_validator_spec.rb index a76c63ccc..f3f4b1288 100644 --- a/spec/validators/poll_validator_spec.rb +++ b/spec/validators/poll_validator_spec.rb @@ -15,14 +15,14 @@ RSpec.describe PollValidator, type: :validator do let(:expires_at) { 1.day.from_now } it 'have no errors' do - expect(errors).not_to have_received(:add) + expect(errors).to_not have_received(:add) end context 'expires just 5 min ago' do let(:expires_at) { 5.minutes.from_now } it 'not calls errors add' do - expect(errors).not_to have_received(:add) + expect(errors).to_not have_received(:add) end end end diff --git a/spec/validators/status_length_validator_spec.rb b/spec/validators/status_length_validator_spec.rb index db9c728a8..e132b5618 100644 --- a/spec/validators/status_length_validator_spec.rb +++ b/spec/validators/status_length_validator_spec.rb @@ -7,13 +7,13 @@ describe StatusLengthValidator do it 'does not add errors onto remote statuses' do status = double(local?: false) subject.validate(status) - expect(status).not_to receive(:errors) + expect(status).to_not receive(:errors) end it 'does not add errors onto local reblogs' do status = double(local?: false, reblog?: true) subject.validate(status) - expect(status).not_to receive(:errors) + expect(status).to_not receive(:errors) end it 'adds an error when content warning is over 500 characters' do diff --git a/spec/validators/unreserved_username_validator_spec.rb b/spec/validators/unreserved_username_validator_spec.rb index e2f051b08..3c6f71c59 100644 --- a/spec/validators/unreserved_username_validator_spec.rb +++ b/spec/validators/unreserved_username_validator_spec.rb @@ -17,7 +17,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do let(:username) { nil } it 'not calls errors.add' do - expect(errors).not_to have_received(:add).with(:username, any_args) + expect(errors).to_not have_received(:add).with(:username, any_args) end end @@ -36,7 +36,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do let(:reserved_username) { false } it 'not calls errors.add' do - expect(errors).not_to have_received(:add).with(:username, any_args) + expect(errors).to_not have_received(:add).with(:username, any_args) end end end diff --git a/spec/validators/url_validator_spec.rb b/spec/validators/url_validator_spec.rb index 85eadeb63..966261b50 100644 --- a/spec/validators/url_validator_spec.rb +++ b/spec/validators/url_validator_spec.rb @@ -27,7 +27,7 @@ RSpec.describe URLValidator, type: :validator do let(:compliant) { true } it 'not calls errors.add' do - expect(errors).not_to have_received(:add).with(attribute, any_args) + expect(errors).to_not have_received(:add).with(attribute, any_args) end end end diff --git a/spec/workers/feed_insert_worker_spec.rb b/spec/workers/feed_insert_worker_spec.rb index fb34970fc..1a723d63a 100644 --- a/spec/workers/feed_insert_worker_spec.rb +++ b/spec/workers/feed_insert_worker_spec.rb @@ -16,7 +16,7 @@ describe FeedInsertWorker do result = subject.perform(nil, follower.id) expect(result).to eq true - expect(instance).not_to have_received(:push_to_home) + expect(instance).to_not have_received(:push_to_home) end it 'skips push with missing account' do @@ -25,7 +25,7 @@ describe FeedInsertWorker do result = subject.perform(status.id, nil) expect(result).to eq true - expect(instance).not_to have_received(:push_to_home) + expect(instance).to_not have_received(:push_to_home) end end @@ -36,7 +36,7 @@ describe FeedInsertWorker do result = subject.perform(status.id, follower.id) expect(result).to be_nil - expect(instance).not_to have_received(:push_to_home) + expect(instance).to_not have_received(:push_to_home) end it 'pushes the status onto the home timeline without filter' do -- cgit From aef0051fd0723ff03175a8851497056ed07d1a83 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 19 Feb 2023 21:16:40 -0500 Subject: Enable Rubocop HTTP status rules (#23717) --- .rubocop.yml | 6 + .rubocop_todo.yml | 171 --------------------- app/controllers/api/v1/accounts_controller.rb | 2 +- .../api/v1/emails/confirmations_controller.rb | 4 +- app/controllers/auth/sessions_controller.rb | 4 +- .../concerns/two_factor_authentication_concern.rb | 4 +- .../webauthn_credentials_controller.rb | 2 +- spec/controllers/admin/accounts_controller_spec.rb | 22 +-- spec/controllers/admin/base_controller_spec.rb | 2 +- .../controllers/admin/instances_controller_spec.rb | 2 +- spec/controllers/admin/roles_controller_spec.rb | 16 +- spec/controllers/admin/users/roles_controller.rb | 4 +- .../api/v1/accounts/credentials_controller_spec.rb | 6 +- .../api/v1/accounts/statuses_controller_spec.rb | 10 +- .../v1/announcements/reactions_controller_spec.rb | 4 +- .../api/v1/announcements_controller_spec.rb | 4 +- .../api/v1/apps/credentials_controller_spec.rb | 2 +- .../api/v1/bookmarks_controller_spec.rb | 6 +- .../api/v1/emails/confirmations_controller_spec.rb | 6 +- .../api/v1/favourites_controller_spec.rb | 6 +- spec/controllers/api/v1/media_controller_spec.rb | 6 +- .../api/v1/timelines/home_controller_spec.rb | 2 +- .../api/v1/timelines/list_controller_spec.rb | 4 +- spec/controllers/api/web/embeds_controller_spec.rb | 6 +- .../auth/registrations_controller_spec.rb | 2 +- spec/controllers/auth/sessions_controller_spec.rb | 2 +- .../concerns/export_controller_concern_spec.rb | 2 +- .../disputes/strikes_controller_spec.rb | 2 +- .../settings/applications_controller_spec.rb | 2 +- .../settings/sessions_controller_spec.rb | 2 +- spec/controllers/shares_controller_spec.rb | 2 +- spec/requests/catch_all_route_request_spec.rb | 4 +- 32 files changed, 77 insertions(+), 242 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index fc1969a64..512c8458f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -88,6 +88,9 @@ Metrics/ModuleLength: Metrics/PerceivedComplexity: Max: 16 # RuboCop default 8 +Rails/HttpStatus: + EnforcedStyle: numeric + Rails/Exit: Exclude: - 'lib/mastodon/*_cli.rb' @@ -97,6 +100,9 @@ Rails/Exit: RSpec/NotToNot: EnforcedStyle: to_not +RSpec/Rails/HttpStatus: + EnforcedStyle: numeric + Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 02f84e70f..521608de6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1427,148 +1427,6 @@ RSpec/PredicateMatcher: - 'spec/models/user_spec.rb' - 'spec/services/post_status_service_spec.rb' -# Offense count: 3 -# This cop supports unsafe autocorrection (--autocorrect-all). -RSpec/Rails/HaveHttpStatus: - Exclude: - - 'spec/controllers/settings/applications_controller_spec.rb' - - 'spec/requests/catch_all_route_request_spec.rb' - -# Offense count: 432 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: numeric, symbolic -RSpec/Rails/HttpStatus: - Exclude: - - 'spec/controllers/about_controller_spec.rb' - - 'spec/controllers/accounts_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/accounts_controller_spec.rb' - - 'spec/controllers/admin/action_logs_controller_spec.rb' - - 'spec/controllers/admin/change_email_controller_spec.rb' - - 'spec/controllers/admin/confirmations_controller_spec.rb' - - 'spec/controllers/admin/custom_emojis_controller_spec.rb' - - 'spec/controllers/admin/dashboard_controller_spec.rb' - - 'spec/controllers/admin/domain_allows_controller_spec.rb' - - 'spec/controllers/admin/domain_blocks_controller_spec.rb' - - 'spec/controllers/admin/email_domain_blocks_controller_spec.rb' - - 'spec/controllers/admin/export_domain_allows_controller_spec.rb' - - 'spec/controllers/admin/export_domain_blocks_controller_spec.rb' - - 'spec/controllers/admin/instances_controller_spec.rb' - - 'spec/controllers/admin/reports/actions_controller_spec.rb' - - 'spec/controllers/admin/reports_controller_spec.rb' - - 'spec/controllers/admin/settings/branding_controller_spec.rb' - - 'spec/controllers/admin/statuses_controller_spec.rb' - - 'spec/controllers/admin/tags_controller_spec.rb' - - 'spec/controllers/api/base_controller_spec.rb' - - 'spec/controllers/api/oembed_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/credentials_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/follower_accounts_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/following_accounts_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/lists_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/notes_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/pins_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/relationships_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/search_controller_spec.rb' - - 'spec/controllers/api/v1/accounts_controller_spec.rb' - - 'spec/controllers/api/v1/admin/account_actions_controller_spec.rb' - - 'spec/controllers/api/v1/admin/accounts_controller_spec.rb' - - 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb' - - 'spec/controllers/api/v1/admin/domain_blocks_controller_spec.rb' - - 'spec/controllers/api/v1/admin/reports_controller_spec.rb' - - 'spec/controllers/api/v1/announcements/reactions_controller_spec.rb' - - 'spec/controllers/api/v1/announcements_controller_spec.rb' - - 'spec/controllers/api/v1/apps/credentials_controller_spec.rb' - - 'spec/controllers/api/v1/apps_controller_spec.rb' - - 'spec/controllers/api/v1/blocks_controller_spec.rb' - - 'spec/controllers/api/v1/conversations_controller_spec.rb' - - 'spec/controllers/api/v1/custom_emojis_controller_spec.rb' - - 'spec/controllers/api/v1/domain_blocks_controller_spec.rb' - - 'spec/controllers/api/v1/endorsements_controller_spec.rb' - - 'spec/controllers/api/v1/filters_controller_spec.rb' - - 'spec/controllers/api/v1/follow_requests_controller_spec.rb' - - 'spec/controllers/api/v1/instances/activity_controller_spec.rb' - - 'spec/controllers/api/v1/instances/peers_controller_spec.rb' - - 'spec/controllers/api/v1/instances_controller_spec.rb' - - 'spec/controllers/api/v1/lists/accounts_controller_spec.rb' - - 'spec/controllers/api/v1/lists_controller_spec.rb' - - 'spec/controllers/api/v1/markers_controller_spec.rb' - - 'spec/controllers/api/v1/media_controller_spec.rb' - - 'spec/controllers/api/v1/mutes_controller_spec.rb' - - 'spec/controllers/api/v1/notifications_controller_spec.rb' - - 'spec/controllers/api/v1/polls/votes_controller_spec.rb' - - 'spec/controllers/api/v1/polls_controller_spec.rb' - - 'spec/controllers/api/v1/reports_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/bookmarks_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/favourites_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/histories_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/mutes_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/pins_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/reblogs_controller_spec.rb' - - 'spec/controllers/api/v1/statuses/sources_controller_spec.rb' - - 'spec/controllers/api/v1/statuses_controller_spec.rb' - - 'spec/controllers/api/v1/streaming_controller_spec.rb' - - 'spec/controllers/api/v1/suggestions_controller_spec.rb' - - 'spec/controllers/api/v1/timelines/home_controller_spec.rb' - - 'spec/controllers/api/v1/timelines/list_controller_spec.rb' - - 'spec/controllers/api/v1/timelines/public_controller_spec.rb' - - 'spec/controllers/api/v1/timelines/tag_controller_spec.rb' - - 'spec/controllers/api/v1/trends/tags_controller_spec.rb' - - 'spec/controllers/api/v2/admin/accounts_controller_spec.rb' - - 'spec/controllers/api/v2/filters/keywords_controller_spec.rb' - - 'spec/controllers/api/v2/filters/statuses_controller_spec.rb' - - 'spec/controllers/api/v2/filters_controller_spec.rb' - - 'spec/controllers/api/v2/search_controller_spec.rb' - - 'spec/controllers/api/web/settings_controller_spec.rb' - - 'spec/controllers/application_controller_spec.rb' - - 'spec/controllers/auth/confirmations_controller_spec.rb' - - 'spec/controllers/auth/passwords_controller_spec.rb' - - 'spec/controllers/auth/registrations_controller_spec.rb' - - 'spec/controllers/auth/sessions_controller_spec.rb' - - 'spec/controllers/authorize_interactions_controller_spec.rb' - - 'spec/controllers/concerns/account_controller_concern_spec.rb' - - 'spec/controllers/concerns/export_controller_concern_spec.rb' - - 'spec/controllers/concerns/signature_verification_spec.rb' - - 'spec/controllers/emojis_controller_spec.rb' - - 'spec/controllers/follower_accounts_controller_spec.rb' - - 'spec/controllers/following_accounts_controller_spec.rb' - - 'spec/controllers/instance_actors_controller_spec.rb' - - 'spec/controllers/intents_controller_spec.rb' - - 'spec/controllers/invites_controller_spec.rb' - - 'spec/controllers/manifests_controller_spec.rb' - - 'spec/controllers/media_controller_spec.rb' - - 'spec/controllers/media_proxy_controller_spec.rb' - - 'spec/controllers/oauth/authorizations_controller_spec.rb' - - 'spec/controllers/oauth/authorized_applications_controller_spec.rb' - - 'spec/controllers/relationships_controller_spec.rb' - - 'spec/controllers/settings/applications_controller_spec.rb' - - 'spec/controllers/settings/deletes_controller_spec.rb' - - 'spec/controllers/settings/exports_controller_spec.rb' - - 'spec/controllers/settings/imports_controller_spec.rb' - - 'spec/controllers/settings/migrations_controller_spec.rb' - - 'spec/controllers/settings/preferences/notifications_controller_spec.rb' - - 'spec/controllers/settings/preferences/other_controller_spec.rb' - - 'spec/controllers/settings/profiles_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/recovery_codes_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication_methods_controller_spec.rb' - - 'spec/controllers/statuses_cleanup_controller_spec.rb' - - 'spec/controllers/statuses_controller_spec.rb' - - 'spec/controllers/tags_controller_spec.rb' - - 'spec/controllers/well_known/host_meta_controller_spec.rb' - - 'spec/controllers/well_known/nodeinfo_controller_spec.rb' - - 'spec/controllers/well_known/webfinger_controller_spec.rb' - - 'spec/requests/host_meta_request_spec.rb' - - 'spec/requests/webfinger_request_spec.rb' - # Offense count: 180 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Inferences. @@ -2159,35 +2017,6 @@ Rails/HttpPositionalArguments: Exclude: - 'spec/config/initializers/rack_attack_spec.rb' -# Offense count: 49 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: numeric, symbolic -Rails/HttpStatus: - Exclude: - - 'app/controllers/activitypub/inboxes_controller.rb' - - 'app/controllers/api/base_controller.rb' - - 'app/controllers/api/v1/admin/domain_blocks_controller.rb' - - 'app/controllers/api/v1/instances/activity_controller.rb' - - 'app/controllers/api/v1/instances/domain_blocks_controller.rb' - - 'app/controllers/api/v1/instances/peers_controller.rb' - - 'app/controllers/api/v1/lists_controller.rb' - - 'app/controllers/api/v1/markers_controller.rb' - - 'app/controllers/api/v1/media_controller.rb' - - 'app/controllers/api/v1/statuses_controller.rb' - - 'app/controllers/api/v1/streaming_controller.rb' - - 'app/controllers/api/v2/media_controller.rb' - - 'app/controllers/api/v2/search_controller.rb' - - 'app/controllers/api/web/base_controller.rb' - - 'app/controllers/settings/pictures_controller.rb' - - 'app/controllers/well_known/webfinger_controller.rb' - - 'spec/controllers/api/base_controller_spec.rb' - - 'spec/controllers/application_controller_spec.rb' - - 'spec/controllers/concerns/account_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' - # Offense count: 7 # Configuration parameters: Include. # Include: spec/**/*.rb, test/**/*.rb diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index be84720aa..7dff66efa 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -30,7 +30,7 @@ class Api::V1::AccountsController < Api::BaseController self.response_body = Oj.dump(response.body) self.status = response.status rescue ActiveRecord::RecordInvalid => e - render json: ValidationErrorFormatter.new(e, 'account.username': :username, 'invite_request.text': :reason).as_json, status: :unprocessable_entity + render json: ValidationErrorFormatter.new(e, 'account.username': :username, 'invite_request.text': :reason).as_json, status: 422 end def follow diff --git a/app/controllers/api/v1/emails/confirmations_controller.rb b/app/controllers/api/v1/emails/confirmations_controller.rb index 3faaea2fb..32fb8e39f 100644 --- a/app/controllers/api/v1/emails/confirmations_controller.rb +++ b/app/controllers/api/v1/emails/confirmations_controller.rb @@ -15,10 +15,10 @@ class Api::V1::Emails::ConfirmationsController < Api::BaseController private def require_user_owned_by_application! - render json: { error: 'This method is only available to the application the user originally signed-up with' }, status: :forbidden unless current_user && current_user.created_by_application_id == doorkeeper_token.application_id + render json: { error: 'This method is only available to the application the user originally signed-up with' }, status: 403 unless current_user && current_user.created_by_application_id == doorkeeper_token.application_id end def require_user_not_confirmed! - render json: { error: 'This method is only available while the e-mail is awaiting confirmation' }, status: :forbidden unless !current_user.confirmed? || current_user.unconfirmed_email.present? + render json: { error: 'This method is only available while the e-mail is awaiting confirmation' }, status: 403 unless !current_user.confirmed? || current_user.unconfirmed_email.present? end end diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index 3ce742638..4f59fd501 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -52,9 +52,9 @@ class Auth::SessionsController < Devise::SessionsController session[:webauthn_challenge] = options_for_get.challenge - render json: options_for_get, status: :ok + render json: options_for_get, status: 200 else - render json: { error: t('webauthn_credentials.not_enabled') }, status: :unauthorized + render json: { error: t('webauthn_credentials.not_enabled') }, status: 401 end end diff --git a/app/controllers/concerns/two_factor_authentication_concern.rb b/app/controllers/concerns/two_factor_authentication_concern.rb index e69b67a79..94f3ce00f 100644 --- a/app/controllers/concerns/two_factor_authentication_concern.rb +++ b/app/controllers/concerns/two_factor_authentication_concern.rb @@ -57,10 +57,10 @@ module TwoFactorAuthenticationConcern if valid_webauthn_credential?(user, webauthn_credential) on_authentication_success(user, :webauthn) - render json: { redirect_path: after_sign_in_path_for(user) }, status: :ok + render json: { redirect_path: after_sign_in_path_for(user) }, status: 200 else on_authentication_failure(user, :webauthn, :invalid_credential) - render json: { error: t('webauthn_credentials.invalid_credential') }, status: :unprocessable_entity + render json: { error: t('webauthn_credentials.invalid_credential') }, status: 422 end end diff --git a/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb b/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb index a50d30f06..e43818c94 100644 --- a/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb +++ b/app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb @@ -27,7 +27,7 @@ module Settings session[:webauthn_challenge] = options_for_create.challenge - render json: options_for_create, status: :ok + render json: options_for_create, status: 200 end def create diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index 35d79740a..f5d68a8ad 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -83,7 +83,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:target_role) { UserRole.find_by(name: 'Admin') } it 'fails to memorialize account' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 expect(account.reload).to_not be_memorial end end @@ -105,7 +105,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:target_role) { UserRole.find_by(name: 'Admin') } it 'fails to memorialize account' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 expect(account.reload).to_not be_memorial end end @@ -114,7 +114,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:target_role) { UserRole.find_by(name: 'Moderator') } it 'fails to memorialize account' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 expect(account.reload).to_not be_memorial end end @@ -141,7 +141,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:role) { UserRole.everyone } it 'fails to enable account' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 expect(user.reload).to be_disabled end end @@ -167,7 +167,7 @@ RSpec.describe Admin::AccountsController, type: :controller do end it 'logs action' do - is_expected.to have_http_status :found + is_expected.to have_http_status 302 log_item = Admin::ActionLog.last @@ -182,7 +182,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:role) { UserRole.everyone } it 'fails to approve account' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 expect(user.reload).to_not be_approved end end @@ -207,7 +207,7 @@ RSpec.describe Admin::AccountsController, type: :controller do end it 'logs action' do - is_expected.to have_http_status :found + is_expected.to have_http_status 302 log_item = Admin::ActionLog.last @@ -222,7 +222,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:role) { UserRole.everyone } it 'fails to reject account' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 expect(user.reload).to_not be_approved end end @@ -250,7 +250,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:role) { UserRole.everyone } it 'fails to redownload' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 end end end @@ -273,7 +273,7 @@ RSpec.describe Admin::AccountsController, type: :controller do let(:role) { UserRole.everyone } it 'fails to remove avatar' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 end end end @@ -303,7 +303,7 @@ RSpec.describe Admin::AccountsController, type: :controller do it 'fails to remove avatar' do subject - expect(response).to have_http_status :forbidden + expect(response).to have_http_status 403 end end end diff --git a/spec/controllers/admin/base_controller_spec.rb b/spec/controllers/admin/base_controller_spec.rb index 44be91951..5fbf8777c 100644 --- a/spec/controllers/admin/base_controller_spec.rb +++ b/spec/controllers/admin/base_controller_spec.rb @@ -15,7 +15,7 @@ describe Admin::BaseController, type: :controller do sign_in(Fabricate(:user)) get :success - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end it 'renders admin layout as a moderator' do diff --git a/spec/controllers/admin/instances_controller_spec.rb b/spec/controllers/admin/instances_controller_spec.rb index 337f7a80c..a7e348b1c 100644 --- a/spec/controllers/admin/instances_controller_spec.rb +++ b/spec/controllers/admin/instances_controller_spec.rb @@ -50,7 +50,7 @@ RSpec.describe Admin::InstancesController, type: :controller do let(:role) { nil } it 'fails to purge instance' do - is_expected.to have_http_status :forbidden + is_expected.to have_http_status 403 end end end diff --git a/spec/controllers/admin/roles_controller_spec.rb b/spec/controllers/admin/roles_controller_spec.rb index 8ff891205..e2b1030d9 100644 --- a/spec/controllers/admin/roles_controller_spec.rb +++ b/spec/controllers/admin/roles_controller_spec.rb @@ -18,7 +18,7 @@ describe Admin::RolesController do context 'when user does not have permission to manage roles' do it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end @@ -38,7 +38,7 @@ describe Admin::RolesController do context 'when user does not have permission to manage roles' do it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end @@ -128,7 +128,7 @@ describe Admin::RolesController do context 'when user does not have permission to manage roles' do it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end @@ -145,7 +145,7 @@ describe Admin::RolesController do let(:role_position) { current_role.position + 1 } it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end end @@ -165,7 +165,7 @@ describe Admin::RolesController do context 'when user does not have permission to manage roles' do it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end it 'does not update the role' do @@ -203,7 +203,7 @@ describe Admin::RolesController do let(:role_position) { current_role.position + 1 } it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end it 'does not update the role' do @@ -224,7 +224,7 @@ describe Admin::RolesController do context 'when user does not have permission to manage roles' do it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end @@ -241,7 +241,7 @@ describe Admin::RolesController do let(:role_position) { current_role.position + 1 } it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end end diff --git a/spec/controllers/admin/users/roles_controller.rb b/spec/controllers/admin/users/roles_controller.rb index bd6a3fa67..9fa8aef41 100644 --- a/spec/controllers/admin/users/roles_controller.rb +++ b/spec/controllers/admin/users/roles_controller.rb @@ -26,7 +26,7 @@ describe Admin::Users::RolesController do let(:previous_role) { UserRole.create(name: 'Baz', permissions: UserRole::FLAGS[:administrator], position: 100) } it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end end @@ -74,7 +74,7 @@ describe Admin::Users::RolesController do end it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end end diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb index a56b9d8fa..cf91aae38 100644 --- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb @@ -78,7 +78,7 @@ describe Api::V1::Accounts::CredentialsController do end it 'returns http unprocessable entity' do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(422) end end end @@ -92,14 +92,14 @@ describe Api::V1::Accounts::CredentialsController do describe 'GET #show' do it 'returns http unauthorized' do get :show - expect(response).to have_http_status(:unauthorized) + expect(response).to have_http_status(401) end end describe 'PATCH #update' do it 'returns http unauthorized' do patch :update, params: { note: 'Foo' } - expect(response).to have_http_status(:unauthorized) + expect(response).to have_http_status(401) end end end diff --git a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb index 01d745fc0..4630fac90 100644 --- a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb @@ -16,7 +16,7 @@ describe Api::V1::Accounts::StatusesController do it 'returns http success' do get :index, params: { account_id: user.account.id, limit: 1 } - expect(response).to have_http_status(:ok) + expect(response).to have_http_status(200) end it 'returns expected headers' do @@ -29,7 +29,7 @@ describe Api::V1::Accounts::StatusesController do it 'returns http success' do get :index, params: { account_id: user.account.id, only_media: true } - expect(response).to have_http_status(:ok) + expect(response).to have_http_status(200) end end @@ -44,7 +44,7 @@ describe Api::V1::Accounts::StatusesController do end it 'returns http success' do - expect(response).to have_http_status(:ok) + expect(response).to have_http_status(200) end it 'returns posts along with self replies' do @@ -63,7 +63,7 @@ describe Api::V1::Accounts::StatusesController do it 'returns http success' do get :index, params: { account_id: user.account.id, pinned: true } - expect(response).to have_http_status(:ok) + expect(response).to have_http_status(200) end end @@ -79,7 +79,7 @@ describe Api::V1::Accounts::StatusesController do it 'returns http success' do get :index, params: { account_id: account.id, pinned: true } - expect(response).to have_http_status(:ok) + expect(response).to have_http_status(200) end context 'when user does not follow account' do diff --git a/spec/controllers/api/v1/announcements/reactions_controller_spec.rb b/spec/controllers/api/v1/announcements/reactions_controller_spec.rb index 72620e242..25c52aa1d 100644 --- a/spec/controllers/api/v1/announcements/reactions_controller_spec.rb +++ b/spec/controllers/api/v1/announcements/reactions_controller_spec.rb @@ -15,7 +15,7 @@ RSpec.describe Api::V1::Announcements::ReactionsController, type: :controller do context 'without token' do it 'returns http unauthorized' do put :update, params: { announcement_id: announcement.id, id: '😂' } - expect(response).to have_http_status :unauthorized + expect(response).to have_http_status 401 end end @@ -43,7 +43,7 @@ RSpec.describe Api::V1::Announcements::ReactionsController, type: :controller do context 'without token' do it 'returns http unauthorized' do delete :destroy, params: { announcement_id: announcement.id, id: '😂' } - expect(response).to have_http_status :unauthorized + expect(response).to have_http_status 401 end end diff --git a/spec/controllers/api/v1/announcements_controller_spec.rb b/spec/controllers/api/v1/announcements_controller_spec.rb index 6ee46b60e..eaab2abd8 100644 --- a/spec/controllers/api/v1/announcements_controller_spec.rb +++ b/spec/controllers/api/v1/announcements_controller_spec.rb @@ -15,7 +15,7 @@ RSpec.describe Api::V1::AnnouncementsController, type: :controller do context 'without token' do it 'returns http unprocessable entity' do get :index - expect(response).to have_http_status :unprocessable_entity + expect(response).to have_http_status 422 end end @@ -35,7 +35,7 @@ RSpec.describe Api::V1::AnnouncementsController, type: :controller do context 'without token' do it 'returns http unauthorized' do post :dismiss, params: { id: announcement.id } - expect(response).to have_http_status :unauthorized + expect(response).to have_http_status 401 end end diff --git a/spec/controllers/api/v1/apps/credentials_controller_spec.rb b/spec/controllers/api/v1/apps/credentials_controller_spec.rb index 470093c3c..701ba8acb 100644 --- a/spec/controllers/api/v1/apps/credentials_controller_spec.rb +++ b/spec/controllers/api/v1/apps/credentials_controller_spec.rb @@ -36,7 +36,7 @@ describe Api::V1::Apps::CredentialsController do describe 'GET #show' do it 'returns http unauthorized' do get :show - expect(response).to have_http_status(:unauthorized) + expect(response).to have_http_status(401) end end end diff --git a/spec/controllers/api/v1/bookmarks_controller_spec.rb b/spec/controllers/api/v1/bookmarks_controller_spec.rb index d7c5847b0..279d1a435 100644 --- a/spec/controllers/api/v1/bookmarks_controller_spec.rb +++ b/spec/controllers/api/v1/bookmarks_controller_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Api::V1::BookmarksController, type: :controller do context 'without token' do it 'returns http unauthorized' do get :index - expect(response).to have_http_status :unauthorized + expect(response).to have_http_status 401 end end @@ -24,7 +24,7 @@ RSpec.describe Api::V1::BookmarksController, type: :controller do it 'returns http forbidden' do get :index - expect(response).to have_http_status :forbidden + expect(response).to have_http_status 403 end end @@ -38,7 +38,7 @@ RSpec.describe Api::V1::BookmarksController, type: :controller do it 'returns http unprocessable entity' do get :index - expect(response).to have_http_status :unprocessable_entity + expect(response).to have_http_status 422 end end diff --git a/spec/controllers/api/v1/emails/confirmations_controller_spec.rb b/spec/controllers/api/v1/emails/confirmations_controller_spec.rb index 15ac31cbc..d272ff38d 100644 --- a/spec/controllers/api/v1/emails/confirmations_controller_spec.rb +++ b/spec/controllers/api/v1/emails/confirmations_controller_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Api::V1::Emails::ConfirmationsController, type: :controller do context 'from a random app' do it 'returns http forbidden' do post :create - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end @@ -30,7 +30,7 @@ RSpec.describe Api::V1::Emails::ConfirmationsController, type: :controller do it 'returns http forbidden' do post :create - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end context 'but user changed e-mail and has not confirmed it' do @@ -57,7 +57,7 @@ RSpec.describe Api::V1::Emails::ConfirmationsController, type: :controller do context 'without an oauth token' do it 'returns http unauthorized' do post :create - expect(response).to have_http_status(:unauthorized) + expect(response).to have_http_status(401) end end end diff --git a/spec/controllers/api/v1/favourites_controller_spec.rb b/spec/controllers/api/v1/favourites_controller_spec.rb index 231f76500..512dd0c0d 100644 --- a/spec/controllers/api/v1/favourites_controller_spec.rb +++ b/spec/controllers/api/v1/favourites_controller_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Api::V1::FavouritesController, type: :controller do context 'without token' do it 'returns http unauthorized' do get :index - expect(response).to have_http_status :unauthorized + expect(response).to have_http_status 401 end end @@ -24,7 +24,7 @@ RSpec.describe Api::V1::FavouritesController, type: :controller do it 'returns http forbidden' do get :index - expect(response).to have_http_status :forbidden + expect(response).to have_http_status 403 end end @@ -38,7 +38,7 @@ RSpec.describe Api::V1::FavouritesController, type: :controller do it 'returns http unprocessable entity' do get :index - expect(response).to have_http_status :unprocessable_entity + expect(response).to have_http_status 422 end end diff --git a/spec/controllers/api/v1/media_controller_spec.rb b/spec/controllers/api/v1/media_controller_spec.rb index a1f6ddb24..ef1e439f9 100644 --- a/spec/controllers/api/v1/media_controller_spec.rb +++ b/spec/controllers/api/v1/media_controller_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do end it 'returns http 422' do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(422) end end @@ -106,7 +106,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do it 'returns http not found' do put :update, params: { id: media.id, description: 'Lorem ipsum!!!' } - expect(response).to have_http_status(:not_found) + expect(response).to have_http_status(404) end end @@ -126,7 +126,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do let(:status) { Fabricate(:status, account: user.account) } it 'returns http not found' do - expect(response).to have_http_status(:not_found) + expect(response).to have_http_status(404) end end end diff --git a/spec/controllers/api/v1/timelines/home_controller_spec.rb b/spec/controllers/api/v1/timelines/home_controller_spec.rb index 131c2d92f..bb46d0aba 100644 --- a/spec/controllers/api/v1/timelines/home_controller_spec.rb +++ b/spec/controllers/api/v1/timelines/home_controller_spec.rb @@ -36,7 +36,7 @@ describe Api::V1::Timelines::HomeController do it 'returns http unprocessable entity' do get :show - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(422) expect(response.headers['Link']).to be_nil end end diff --git a/spec/controllers/api/v1/timelines/list_controller_spec.rb b/spec/controllers/api/v1/timelines/list_controller_spec.rb index 526c66a05..4ef5d41af 100644 --- a/spec/controllers/api/v1/timelines/list_controller_spec.rb +++ b/spec/controllers/api/v1/timelines/list_controller_spec.rb @@ -36,7 +36,7 @@ describe Api::V1::Timelines::ListController do describe 'GET #show' do it 'returns http not found' do get :show, params: { id: list.id } - expect(response).to have_http_status(:not_found) + expect(response).to have_http_status(404) end end end @@ -48,7 +48,7 @@ describe Api::V1::Timelines::ListController do it 'returns http unprocessable entity' do get :show, params: { id: list.id } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(422) expect(response.headers['Link']).to be_nil end end diff --git a/spec/controllers/api/web/embeds_controller_spec.rb b/spec/controllers/api/web/embeds_controller_spec.rb index b3ef73915..e03f5a371 100644 --- a/spec/controllers/api/web/embeds_controller_spec.rb +++ b/spec/controllers/api/web/embeds_controller_spec.rb @@ -19,7 +19,7 @@ describe Api::Web::EmbedsController do let(:url) { "http://#{Rails.configuration.x.web_domain}/@#{status.account.username}/#{status.id}" } it 'returns a right response' do - expect(response).to have_http_status :ok + expect(response).to have_http_status 200 expect(body[:author_name]).to eq status.account.username end end @@ -37,7 +37,7 @@ describe Api::Web::EmbedsController do let(:call_result) { { result: :ok } } it 'returns a right response' do - expect(response).to have_http_status :ok + expect(response).to have_http_status 200 expect(body[:result]).to eq 'ok' end end @@ -46,7 +46,7 @@ describe Api::Web::EmbedsController do let(:call_result) { nil } it 'returns a right response' do - expect(response).to have_http_status :not_found + expect(response).to have_http_status 404 end end end diff --git a/spec/controllers/auth/registrations_controller_spec.rb b/spec/controllers/auth/registrations_controller_spec.rb index 7298bde00..52023eb2e 100644 --- a/spec/controllers/auth/registrations_controller_spec.rb +++ b/spec/controllers/auth/registrations_controller_spec.rb @@ -245,7 +245,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do end it 'returns http not found' do - expect(response).to have_http_status(:not_found) + expect(response).to have_http_status(404) end it 'does not delete user' do diff --git a/spec/controllers/auth/sessions_controller_spec.rb b/spec/controllers/auth/sessions_controller_spec.rb index eb03dff50..58befa124 100644 --- a/spec/controllers/auth/sessions_controller_spec.rb +++ b/spec/controllers/auth/sessions_controller_spec.rb @@ -422,7 +422,7 @@ RSpec.describe Auth::SessionsController, type: :controller do it 'returns http success' do get :webauthn_options - expect(response).to have_http_status :ok + expect(response).to have_http_status 200 end end end diff --git a/spec/controllers/concerns/export_controller_concern_spec.rb b/spec/controllers/concerns/export_controller_concern_spec.rb index 1a5e46f8e..003fd17f6 100644 --- a/spec/controllers/concerns/export_controller_concern_spec.rb +++ b/spec/controllers/concerns/export_controller_concern_spec.rb @@ -29,7 +29,7 @@ describe ApplicationController, type: :controller do it 'returns unauthorized when not signed in' do get :index, format: :csv - expect(response).to have_http_status(:unauthorized) + expect(response).to have_http_status(401) end end end diff --git a/spec/controllers/disputes/strikes_controller_spec.rb b/spec/controllers/disputes/strikes_controller_spec.rb index 157f9ec3c..e060d37ac 100644 --- a/spec/controllers/disputes/strikes_controller_spec.rb +++ b/spec/controllers/disputes/strikes_controller_spec.rb @@ -23,7 +23,7 @@ RSpec.describe Disputes::StrikesController, type: :controller do let(:strike) { Fabricate(:account_warning) } it 'returns http forbidden' do - expect(response).to have_http_status(:forbidden) + expect(response).to have_http_status(403) end end end diff --git a/spec/controllers/settings/applications_controller_spec.rb b/spec/controllers/settings/applications_controller_spec.rb index 35ad4b2e7..33d874d10 100644 --- a/spec/controllers/settings/applications_controller_spec.rb +++ b/spec/controllers/settings/applications_controller_spec.rb @@ -32,7 +32,7 @@ describe Settings::ApplicationsController do app.update!(owner: nil) get :show, params: { id: app.id } - expect(response.status).to eq 404 + expect(response).to have_http_status 404 end end diff --git a/spec/controllers/settings/sessions_controller_spec.rb b/spec/controllers/settings/sessions_controller_spec.rb index 0e312c5a6..59c18889e 100644 --- a/spec/controllers/settings/sessions_controller_spec.rb +++ b/spec/controllers/settings/sessions_controller_spec.rb @@ -24,7 +24,7 @@ describe Settings::SessionsController do let(:id) { session_activation.id + 1000 } it 'destroys session activation' do - is_expected.to have_http_status :not_found + is_expected.to have_http_status 404 end end end diff --git a/spec/controllers/shares_controller_spec.rb b/spec/controllers/shares_controller_spec.rb index e365b356e..0fde8c692 100644 --- a/spec/controllers/shares_controller_spec.rb +++ b/spec/controllers/shares_controller_spec.rb @@ -13,7 +13,7 @@ describe SharesController do before { get :show, params: { title: 'test title', text: 'test text', url: 'url1 url2' } } it 'returns http success' do - expect(response).to have_http_status :ok + expect(response).to have_http_status 200 expect(body_classes).to eq 'modal-layout compose-standalone' end end diff --git a/spec/requests/catch_all_route_request_spec.rb b/spec/requests/catch_all_route_request_spec.rb index fb18965d8..dcfc1bf4b 100644 --- a/spec/requests/catch_all_route_request_spec.rb +++ b/spec/requests/catch_all_route_request_spec.rb @@ -5,7 +5,7 @@ describe 'The catch all route' do it 'returns a 404 page as html' do get '/test' - expect(response.status).to eq 404 + expect(response).to have_http_status 404 expect(response.media_type).to eq 'text/html' end end @@ -14,7 +14,7 @@ describe 'The catch all route' do it 'returns a 404 page as html' do get '/test.test' - expect(response.status).to eq 404 + expect(response).to have_http_status 404 expect(response.media_type).to eq 'text/html' end end -- cgit From 59c8d43d94aa782848bf00f000512a04fca7c069 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 20 Feb 2023 05:01:20 -0500 Subject: Autofix Rubocop Style/RescueStandardError (#23745) --- .rubocop.yml | 3 +++ .rubocop_todo.yml | 18 ------------------ app/lib/request_pool.rb | 2 +- app/services/import_service.rb | 2 +- lib/mastodon/domains_cli.rb | 2 +- lib/tasks/mastodon.rake | 6 +++--- 6 files changed, 9 insertions(+), 24 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 512c8458f..27d778edf 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -115,6 +115,9 @@ Style/PercentLiteralDelimiters: '%i': '()' '%w': '()' +Style/RescueStandardError: + EnforcedStyle: implicit + Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: 'comma' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f365914cb..bb214a70b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2234,24 +2234,6 @@ Style/RegexpLiteral: - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/tasks/mastodon.rake' -# Offense count: 21 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: implicit, explicit -Style/RescueStandardError: - Exclude: - - 'app/lib/activitypub/activity/move.rb' - - 'app/lib/request.rb' - - 'app/models/account.rb' - - 'app/workers/move_worker.rb' - - 'app/workers/scheduler/vacuum_scheduler.rb' - - 'lib/mastodon/accounts_cli.rb' - - 'lib/mastodon/cli_helper.rb' - - 'lib/mastodon/media_cli.rb' - - 'lib/mastodon/sidekiq_middleware.rb' - - 'lib/mastodon/statuses_cli.rb' - - 'lib/mastodon/upgrade_cli.rb' - # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. diff --git a/app/lib/request_pool.rb b/app/lib/request_pool.rb index e5899a79a..6be172286 100644 --- a/app/lib/request_pool.rb +++ b/app/lib/request_pool.rb @@ -64,7 +64,7 @@ class RequestPool retries += 1 retry end - rescue StandardError + rescue # If this connection raises errors of any kind, it's # better if it gets reaped as soon as possible diff --git a/app/services/import_service.rb b/app/services/import_service.rb index 2f48abc36..7a68e4ca3 100644 --- a/app/services/import_service.rb +++ b/app/services/import_service.rb @@ -114,7 +114,7 @@ class ImportService < BaseService status || ActivityPub::FetchRemoteStatusService.new.call(uri) rescue HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::UnexpectedResponseError nil - rescue StandardError => e + rescue => e Rails.logger.warn "Unexpected error when importing bookmark: #{e}" nil end diff --git a/lib/mastodon/domains_cli.rb b/lib/mastodon/domains_cli.rb index 41ea5b152..05f08f462 100644 --- a/lib/mastodon/domains_cli.rb +++ b/lib/mastodon/domains_cli.rb @@ -165,7 +165,7 @@ module Mastodon stats[domain]['activity'] = Oj.load(res.to_s) end - rescue StandardError + rescue failed.increment ensure processed.increment diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index f919ba989..0a3946ac7 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -92,7 +92,7 @@ namespace :mastodon do prompt.ok 'Database configuration works! 🎆' db_connection_works = true break - rescue StandardError => e + rescue => e prompt.error 'Database connection could not be established with this configuration, try again.' prompt.error e.message break unless prompt.yes?('Try again?') @@ -132,7 +132,7 @@ namespace :mastodon do redis.ping prompt.ok 'Redis configuration works! 🎆' break - rescue StandardError => e + rescue => e prompt.error 'Redis connection could not be established with this configuration, try again.' prompt.error e.message break unless prompt.yes?('Try again?') @@ -417,7 +417,7 @@ namespace :mastodon do mail = ActionMailer::Base.new.mail to: send_to, subject: 'Test', body: 'Mastodon SMTP configuration works!' mail.deliver break - rescue StandardError => e + rescue => e prompt.error 'E-mail could not be sent with this configuration, try again.' prompt.error e.message break unless prompt.yes?('Try again?') -- cgit From 5a8c651e8f0252c7135042e79396f782361302d9 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 3 Mar 2023 21:06:31 +0100 Subject: Only offer translation for supported languages (#23879) --- .rubocop.yml | 4 + .../mastodon/components/status_content.jsx | 4 +- app/javascript/mastodon/initial_state.js | 2 - app/lib/translation_service.rb | 4 + app/lib/translation_service/deepl.rb | 46 +++++++--- app/lib/translation_service/libre_translate.rb | 38 +++++--- app/models/status.rb | 10 +++ app/serializers/initial_state_serializer.rb | 1 - app/serializers/rest/status_serializer.rb | 6 +- app/services/translate_status_service.rb | 2 +- spec/lib/translation_service/deepl_spec.rb | 100 +++++++++++++++++++++ .../translation_service/libre_translate_spec.rb | 71 +++++++++++++++ spec/models/status_spec.rb | 79 ++++++++++++++++ 13 files changed, 336 insertions(+), 31 deletions(-) create mode 100644 spec/lib/translation_service/deepl_spec.rb create mode 100644 spec/lib/translation_service/libre_translate_spec.rb (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 27d778edf..0a41c54b9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -97,6 +97,10 @@ Rails/Exit: - 'lib/mastodon/cli_helper.rb' - 'lib/cli.rb' +RSpec/FilePath: + CustomTransform: + DeepL: deepl + RSpec/NotToNot: EnforcedStyle: to_not diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx index a1c38171f..f9c9fe079 100644 --- a/app/javascript/mastodon/components/status_content.jsx +++ b/app/javascript/mastodon/components/status_content.jsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import classnames from 'classnames'; import PollContainer from 'mastodon/containers/poll_container'; import Icon from 'mastodon/components/icon'; -import { autoPlayGif, languages as preloadedLanguages, translationEnabled } from 'mastodon/initial_state'; +import { autoPlayGif, languages as preloadedLanguages } from 'mastodon/initial_state'; const MAX_HEIGHT = 706; // 22px * 32 (+ 2px padding at the top) @@ -220,7 +220,7 @@ class StatusContent extends React.PureComponent { const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; const renderReadMore = this.props.onClick && status.get('collapsed'); - const renderTranslate = translationEnabled && this.context.identity.signedIn && this.props.onTranslate && ['public', 'unlisted'].includes(status.get('visibility')) && status.get('contentHtml').length > 0 && status.get('language') !== null && intl.locale !== status.get('language'); + const renderTranslate = this.props.onTranslate && status.get('translatable'); const content = { __html: status.get('translation') ? status.getIn(['translation', 'content']) : status.get('contentHtml') }; const spoilerContent = { __html: status.get('spoilerHtml') }; diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index d04c4a42d..919e0fc28 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -80,7 +80,6 @@ * @property {boolean} use_blurhash * @property {boolean=} use_pending_items * @property {string} version - * @property {boolean} translation_enabled */ /** @@ -132,7 +131,6 @@ export const unfollowModal = getMeta('unfollow_modal'); export const useBlurhash = getMeta('use_blurhash'); export const usePendingItems = getMeta('use_pending_items'); export const version = getMeta('version'); -export const translationEnabled = getMeta('translation_enabled'); export const languages = initialState?.languages; export const statusPageUrl = getMeta('status_page_url'); diff --git a/app/lib/translation_service.rb b/app/lib/translation_service.rb index 285f30939..5ff93674a 100644 --- a/app/lib/translation_service.rb +++ b/app/lib/translation_service.rb @@ -21,6 +21,10 @@ class TranslationService ENV['DEEPL_API_KEY'].present? || ENV['LIBRE_TRANSLATE_ENDPOINT'].present? end + def supported?(_source_language, _target_language) + false + end + def translate(_text, _source_language, _target_language) raise NotImplementedError end diff --git a/app/lib/translation_service/deepl.rb b/app/lib/translation_service/deepl.rb index 151d33d90..deff95a1d 100644 --- a/app/lib/translation_service/deepl.rb +++ b/app/lib/translation_service/deepl.rb @@ -11,33 +11,53 @@ class TranslationService::DeepL < TranslationService end def translate(text, source_language, target_language) - request(text, source_language, target_language).perform do |res| + form = { text: text, source_lang: source_language&.upcase, target_lang: target_language, tag_handling: 'html' } + request(:post, '/v2/translate', form: form) do |res| + transform_response(res.body_with_limit) + end + end + + def supported?(source_language, target_language) + source_language.in?(languages('source')) && target_language.in?(languages('target')) + end + + private + + def languages(type) + Rails.cache.fetch("translation_service/deepl/languages/#{type}", expires_in: 7.days, race_condition_ttl: 1.minute) do + request(:get, "/v2/languages?type=#{type}") do |res| + # In DeepL, EN and PT are deprecated in favor of EN-GB/EN-US and PT-BR/PT-PT, so + # they are supported but not returned by the API. + extra = type == 'source' ? [nil] : %w(en pt) + languages = Oj.load(res.body_with_limit).map { |language| language['language'].downcase } + + languages + extra + end + end + end + + def request(verb, path, **options) + req = Request.new(verb, "#{base_url}#{path}", **options) + req.add_headers(Authorization: "DeepL-Auth-Key #{@api_key}") + req.perform do |res| case res.code when 429 raise TooManyRequestsError when 456 raise QuotaExceededError when 200...300 - transform_response(res.body_with_limit) + yield res else raise UnexpectedResponseError end end end - private - - def request(text, source_language, target_language) - req = Request.new(:post, endpoint_url, form: { text: text, source_lang: source_language&.upcase, target_lang: target_language, tag_handling: 'html' }) - req.add_headers(Authorization: "DeepL-Auth-Key #{@api_key}") - req - end - - def endpoint_url + def base_url if @plan == 'free' - 'https://api-free.deepl.com/v2/translate' + 'https://api-free.deepl.com' else - 'https://api.deepl.com/v2/translate' + 'https://api.deepl.com' end end diff --git a/app/lib/translation_service/libre_translate.rb b/app/lib/translation_service/libre_translate.rb index 4ebe21e45..743e4d77f 100644 --- a/app/lib/translation_service/libre_translate.rb +++ b/app/lib/translation_service/libre_translate.rb @@ -9,29 +9,45 @@ class TranslationService::LibreTranslate < TranslationService end def translate(text, source_language, target_language) - request(text, source_language, target_language).perform do |res| + body = Oj.dump(q: text, source: source_language.presence || 'auto', target: target_language, format: 'html', api_key: @api_key) + request(:post, '/translate', body: body) do |res| + transform_response(res.body_with_limit, source_language) + end + end + + def supported?(source_language, target_language) + languages.key?(source_language) && languages[source_language].include?(target_language) + end + + private + + def languages + Rails.cache.fetch('translation_service/libre_translate/languages', expires_in: 7.days, race_condition_ttl: 1.minute) do + request(:get, '/languages') do |res| + languages = Oj.load(res.body_with_limit).to_h { |language| [language['code'], language['targets']] } + languages[nil] = languages.values.flatten.uniq + languages + end + end + end + + def request(verb, path, **options) + req = Request.new(verb, "#{@base_url}#{path}", allow_local: true, **options) + req.add_headers('Content-Type': 'application/json') + req.perform do |res| case res.code when 429 raise TooManyRequestsError when 403 raise QuotaExceededError when 200...300 - transform_response(res.body_with_limit, source_language) + yield res else raise UnexpectedResponseError end end end - private - - def request(text, source_language, target_language) - body = Oj.dump(q: text, source: source_language.presence || 'auto', target: target_language, format: 'html', api_key: @api_key) - req = Request.new(:post, "#{@base_url}/translate", body: body, allow_local: true) - req.add_headers('Content-Type': 'application/json') - req - end - def transform_response(str, source_language) json = Oj.load(str, mode: :strict) diff --git a/app/models/status.rb b/app/models/status.rb index e7ea191a8..dd7ac2edb 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -232,6 +232,16 @@ class Status < ApplicationRecord public_visibility? || unlisted_visibility? end + def translatable? + translate_target_locale = I18n.locale.to_s.split(/[_-]/).first + + distributable? && + content.present? && + language != translate_target_locale && + TranslationService.configured? && + TranslationService.configured.supported?(language, translate_target_locale) + end + alias sign? distributable? def with_media? diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 7905444e9..769ba653e 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -30,7 +30,6 @@ class InitialStateSerializer < ActiveModel::Serializer timeline_preview: Setting.timeline_preview, activity_api_enabled: Setting.activity_api_enabled, single_user_mode: Rails.configuration.x.single_user_mode, - translation_enabled: TranslationService.configured?, trends_as_landing_page: Setting.trends_as_landing_page, status_page_url: Setting.status_page_url, } diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index e0b8f32a6..a422f5b25 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -4,7 +4,7 @@ class REST::StatusSerializer < ActiveModel::Serializer include FormattingHelper attributes :id, :created_at, :in_reply_to_id, :in_reply_to_account_id, - :sensitive, :spoiler_text, :visibility, :language, + :sensitive, :spoiler_text, :visibility, :language, :translatable, :uri, :url, :replies_count, :reblogs_count, :favourites_count, :edited_at @@ -50,6 +50,10 @@ class REST::StatusSerializer < ActiveModel::Serializer object.account.user_shows_application? || (current_user? && current_user.account_id == object.account_id) end + def translatable + current_user? && object.translatable? + end + def visibility # This visibility is masked behind "private" # to avoid API changes because there are no diff --git a/app/services/translate_status_service.rb b/app/services/translate_status_service.rb index 539a0d9db..92d8b62a0 100644 --- a/app/services/translate_status_service.rb +++ b/app/services/translate_status_service.rb @@ -6,7 +6,7 @@ class TranslateStatusService < BaseService include FormattingHelper def call(status, target_language) - raise Mastodon::NotPermittedError unless status.public_visibility? || status.unlisted_visibility? + raise Mastodon::NotPermittedError unless status.translatable? @status = status @content = status_content_format(@status) diff --git a/spec/lib/translation_service/deepl_spec.rb b/spec/lib/translation_service/deepl_spec.rb new file mode 100644 index 000000000..aa2473186 --- /dev/null +++ b/spec/lib/translation_service/deepl_spec.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe TranslationService::DeepL do + subject(:service) { described_class.new(plan, 'my-api-key') } + + let(:plan) { 'advanced' } + + before do + stub_request(:get, 'https://api.deepl.com/v2/languages?type=source').to_return( + body: '[{"language":"EN","name":"English"},{"language":"UK","name":"Ukrainian"}]' + ) + stub_request(:get, 'https://api.deepl.com/v2/languages?type=target').to_return( + body: '[{"language":"EN-GB","name":"English (British)"},{"language":"ZH","name":"Chinese"}]' + ) + end + + describe '#supported?' do + it 'supports included languages as source and target languages' do + expect(service.supported?('uk', 'en')).to be true + end + + it 'supports auto-detecting source language' do + expect(service.supported?(nil, 'en')).to be true + end + + it 'supports "en" and "pt" as target languages though not included in language list' do + expect(service.supported?('uk', 'en')).to be true + expect(service.supported?('uk', 'pt')).to be true + end + + it 'does not support non-included language as target language' do + expect(service.supported?('uk', 'nl')).to be false + end + + it 'does not support non-included language as source language' do + expect(service.supported?('da', 'en')).to be false + end + end + + describe '#translate' do + it 'returns translation with specified source language' do + stub_request(:post, 'https://api.deepl.com/v2/translate') + .with(body: 'text=Hasta+la+vista&source_lang=ES&target_lang=en&tag_handling=html') + .to_return(body: '{"translations":[{"detected_source_language":"ES","text":"See you soon"}]}') + + translation = service.translate('Hasta la vista', 'es', 'en') + expect(translation.detected_source_language).to eq 'es' + expect(translation.provider).to eq 'DeepL.com' + expect(translation.text).to eq 'See you soon' + end + + it 'returns translation with auto-detected source language' do + stub_request(:post, 'https://api.deepl.com/v2/translate') + .with(body: 'text=Guten+Tag&source_lang&target_lang=en&tag_handling=html') + .to_return(body: '{"translations":[{"detected_source_language":"DE","text":"Good Morning"}]}') + + translation = service.translate('Guten Tag', nil, 'en') + expect(translation.detected_source_language).to eq 'de' + expect(translation.provider).to eq 'DeepL.com' + expect(translation.text).to eq 'Good Morning' + end + end + + describe '#languages?' do + it 'returns source languages' do + expect(service.send(:languages, 'source')).to eq ['en', 'uk', nil] + end + + it 'returns target languages' do + expect(service.send(:languages, 'target')).to eq %w(en-gb zh en pt) + end + end + + describe '#request' do + before do + stub_request(:any, //) + # rubocop:disable Lint/EmptyBlock + service.send(:request, :get, '/v2/languages') { |res| } + # rubocop:enable Lint/EmptyBlock + end + + it 'uses paid plan base URL' do + expect(a_request(:get, 'https://api.deepl.com/v2/languages')).to have_been_made.once + end + + context 'with free plan' do + let(:plan) { 'free' } + + it 'uses free plan base URL' do + expect(a_request(:get, 'https://api-free.deepl.com/v2/languages')).to have_been_made.once + end + end + + it 'sends API key' do + expect(a_request(:get, 'https://api.deepl.com/v2/languages').with(headers: { Authorization: 'DeepL-Auth-Key my-api-key' })).to have_been_made.once + end + end +end diff --git a/spec/lib/translation_service/libre_translate_spec.rb b/spec/lib/translation_service/libre_translate_spec.rb new file mode 100644 index 000000000..a6cb01884 --- /dev/null +++ b/spec/lib/translation_service/libre_translate_spec.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe TranslationService::LibreTranslate do + subject(:service) { described_class.new('https://libretranslate.example.com', 'my-api-key') } + + before do + stub_request(:get, 'https://libretranslate.example.com/languages').to_return( + body: '[{"code": "en","name": "English","targets": ["de","es"]},{"code": "da","name": "Danish","targets": ["en","de"]}]' + ) + end + + describe '#supported?' do + it 'supports included language pair' do + expect(service.supported?('en', 'de')).to be true + end + + it 'does not support reversed language pair' do + expect(service.supported?('de', 'en')).to be false + end + + it 'supports auto-detecting source language' do + expect(service.supported?(nil, 'de')).to be true + end + + it 'does not support auto-detecting for unsupported target language' do + expect(service.supported?(nil, 'pt')).to be false + end + end + + describe '#languages' do + subject(:languages) { service.send(:languages) } + + it 'includes supported source languages' do + expect(languages.keys).to eq ['en', 'da', nil] + end + + it 'includes supported target languages for source language' do + expect(languages['en']).to eq %w(de es) + end + + it 'includes supported target languages for auto-detected language' do + expect(languages[nil]).to eq %w(de es en) + end + end + + describe '#translate' do + it 'returns translation with specified source language' do + stub_request(:post, 'https://libretranslate.example.com/translate') + .with(body: '{"q":"Hasta la vista","source":"es","target":"en","format":"html","api_key":"my-api-key"}') + .to_return(body: '{"translatedText": "See you"}') + + translation = service.translate('Hasta la vista', 'es', 'en') + expect(translation.detected_source_language).to eq 'es' + expect(translation.provider).to eq 'LibreTranslate' + expect(translation.text).to eq 'See you' + end + + it 'returns translation with auto-detected source language' do + stub_request(:post, 'https://libretranslate.example.com/translate') + .with(body: '{"q":"Guten Morgen","source":"auto","target":"en","format":"html","api_key":"my-api-key"}') + .to_return(body: '{"detectedLanguage":{"confidence":92,"language":"de"},"translatedText":"Good morning"}') + + translation = service.translate('Guten Morgen', nil, 'en') + expect(translation.detected_source_language).to be_nil + expect(translation.provider).to eq 'LibreTranslate' + expect(translation.text).to eq 'Good morning' + end + end +end diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb index 1e58c6d0d..1f6cfc796 100644 --- a/spec/models/status_spec.rb +++ b/spec/models/status_spec.rb @@ -114,6 +114,85 @@ RSpec.describe Status, type: :model do end end + describe '#translatable?' do + before do + allow(TranslationService).to receive(:configured?).and_return(true) + allow(TranslationService).to receive(:configured).and_return(TranslationService.new) + allow(TranslationService.configured).to receive(:supported?).with('es', 'en').and_return(true) + + subject.language = 'es' + subject.visibility = :public + end + + context 'all conditions are satisfied' do + it 'returns true' do + expect(subject.translatable?).to be true + end + end + + context 'translation service is not configured' do + it 'returns false' do + allow(TranslationService).to receive(:configured?).and_return(false) + allow(TranslationService).to receive(:configured).and_raise(TranslationService::NotConfiguredError) + expect(subject.translatable?).to be false + end + end + + context 'status language is nil' do + it 'returns true' do + subject.language = nil + allow(TranslationService.configured).to receive(:supported?).with(nil, 'en').and_return(true) + expect(subject.translatable?).to be true + end + end + + context 'status language is same as default locale' do + it 'returns false' do + subject.language = I18n.locale + expect(subject.translatable?).to be false + end + end + + context 'status language is unsupported' do + it 'returns false' do + subject.language = 'af' + allow(TranslationService.configured).to receive(:supported?).with('af', 'en').and_return(false) + expect(subject.translatable?).to be false + end + end + + context 'default locale is unsupported' do + it 'returns false' do + allow(TranslationService.configured).to receive(:supported?).with('es', 'af').and_return(false) + I18n.with_locale('af') do + expect(subject.translatable?).to be false + end + end + end + + context 'default locale has region' do + it 'returns true' do + I18n.with_locale('en-GB') do + expect(subject.translatable?).to be true + end + end + end + + context 'status text is blank' do + it 'returns false' do + subject.text = ' ' + expect(subject.translatable?).to be false + end + end + + context 'status visiblity is hidden' do + it 'returns false' do + subject.visibility = 'limited' + expect(subject.translatable?).to be false + end + end + end + describe '#content' do it 'returns the text of the status if it is not a reblog' do expect(subject.content).to eql subject.text -- cgit From aa98c8fbeb02fecac2681464fd7c0445deb466b1 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Mar 2023 22:55:43 +0100 Subject: Disable Style/SymbolArray (#23921) --- .rubocop.yml | 3 ++ .rubocop_todo.yml | 131 ------------------------------------------------------ 2 files changed, 3 insertions(+), 131 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 0a41c54b9..f7ed79b76 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -127,3 +127,6 @@ Style/TrailingCommaInArrayLiteral: Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: 'comma' + +Style/SymbolArray: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 22e1a99c1..b53f655bd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2235,134 +2235,3 @@ Style/SlicingWithRange: - 'lib/active_record/batches.rb' - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/tasks/repo.rake' - -# Offense count: 272 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, MinSize. -# SupportedStyles: percent, brackets -Style/SymbolArray: - Exclude: - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/activitypub/replies_controller.rb' - - 'app/controllers/admin/accounts_controller.rb' - - 'app/controllers/admin/announcements_controller.rb' - - 'app/controllers/admin/domain_blocks_controller.rb' - - 'app/controllers/admin/email_domain_blocks_controller.rb' - - 'app/controllers/admin/relationships_controller.rb' - - 'app/controllers/admin/relays_controller.rb' - - 'app/controllers/admin/roles_controller.rb' - - 'app/controllers/admin/rules_controller.rb' - - 'app/controllers/admin/statuses_controller.rb' - - 'app/controllers/admin/trends/statuses_controller.rb' - - 'app/controllers/admin/warning_presets_controller.rb' - - 'app/controllers/admin/webhooks_controller.rb' - - 'app/controllers/api/v1/accounts/credentials_controller.rb' - - 'app/controllers/api/v1/accounts_controller.rb' - - 'app/controllers/api/v1/admin/accounts_controller.rb' - - 'app/controllers/api/v1/admin/canonical_email_blocks_controller.rb' - - 'app/controllers/api/v1/admin/domain_allows_controller.rb' - - 'app/controllers/api/v1/admin/domain_blocks_controller.rb' - - 'app/controllers/api/v1/admin/email_domain_blocks_controller.rb' - - 'app/controllers/api/v1/admin/ip_blocks_controller.rb' - - 'app/controllers/api/v1/admin/reports_controller.rb' - - 'app/controllers/api/v1/crypto/deliveries_controller.rb' - - 'app/controllers/api/v1/crypto/keys/claims_controller.rb' - - 'app/controllers/api/v1/crypto/keys/uploads_controller.rb' - - 'app/controllers/api/v1/featured_tags_controller.rb' - - 'app/controllers/api/v1/filters_controller.rb' - - 'app/controllers/api/v1/lists_controller.rb' - - 'app/controllers/api/v1/notifications_controller.rb' - - 'app/controllers/api/v1/push/subscriptions_controller.rb' - - 'app/controllers/api/v1/scheduled_statuses_controller.rb' - - 'app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb' - - 'app/controllers/api/v1/statuses_controller.rb' - - 'app/controllers/api/v2/filters/keywords_controller.rb' - - 'app/controllers/api/v2/filters/statuses_controller.rb' - - 'app/controllers/api/v2/filters_controller.rb' - - 'app/controllers/api/web/push_subscriptions_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/auth/registrations_controller.rb' - - 'app/controllers/filters_controller.rb' - - 'app/controllers/settings/applications_controller.rb' - - 'app/controllers/settings/featured_tags_controller.rb' - - 'app/controllers/settings/profiles_controller.rb' - - 'app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb' - - 'app/controllers/statuses_controller.rb' - - 'app/lib/feed_manager.rb' - - 'app/models/account.rb' - - 'app/models/account_filter.rb' - - 'app/models/admin/status_filter.rb' - - 'app/models/announcement.rb' - - 'app/models/concerns/ldap_authenticable.rb' - - 'app/models/concerns/status_threading_concern.rb' - - 'app/models/custom_filter.rb' - - 'app/models/domain_block.rb' - - 'app/models/import.rb' - - 'app/models/list.rb' - - 'app/models/media_attachment.rb' - - 'app/models/preview_card.rb' - - 'app/models/relay.rb' - - 'app/models/report.rb' - - 'app/models/site_upload.rb' - - 'app/models/status.rb' - - 'app/serializers/initial_state_serializer.rb' - - 'app/serializers/rest/notification_serializer.rb' - - 'db/migrate/20160220174730_create_accounts.rb' - - 'db/migrate/20160221003621_create_follows.rb' - - 'db/migrate/20160223171800_create_favourites.rb' - - 'db/migrate/20160224223247_create_mentions.rb' - - 'db/migrate/20160314164231_add_owner_to_application.rb' - - 'db/migrate/20160316103650_add_missing_indices.rb' - - 'db/migrate/20160926213048_remove_owner_from_application.rb' - - 'db/migrate/20161003145426_create_blocks.rb' - - 'db/migrate/20161006213403_rails_settings_migration.rb' - - 'db/migrate/20161105130633_create_statuses_tags_join_table.rb' - - 'db/migrate/20161119211120_create_notifications.rb' - - 'db/migrate/20161128103007_create_subscriptions.rb' - - 'db/migrate/20161222204147_create_follow_requests.rb' - - 'db/migrate/20170112154826_migrate_settings.rb' - - 'db/migrate/20170301222600_create_mutes.rb' - - 'db/migrate/20170406215816_add_notifications_and_favourites_indices.rb' - - 'db/migrate/20170424003227_create_account_domain_blocks.rb' - - 'db/migrate/20170427011934_re_add_owner_to_application.rb' - - 'db/migrate/20170507141759_optimize_index_subscriptions.rb' - - 'db/migrate/20170508230434_create_conversation_mutes.rb' - - 'db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb' - - 'db/migrate/20170823162448_create_status_pins.rb' - - 'db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb' - - 'db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb' - - 'db/migrate/20170917153509_create_custom_emojis.rb' - - 'db/migrate/20170918125918_ids_to_bigints.rb' - - 'db/migrate/20171116161857_create_list_accounts.rb' - - 'db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb' - - 'db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb' - - 'db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb' - - 'db/migrate/20171129172043_add_index_on_stream_entries.rb' - - 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' - - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180808175627_create_account_pins.rb' - - 'db/migrate/20180831171112_create_bookmarks.rb' - - 'db/migrate/20180929222014_create_account_conversations.rb' - - 'db/migrate/20181007025445_create_pghero_space_stats.rb' - - 'db/migrate/20181203003808_create_accounts_tags_join_table.rb' - - 'db/migrate/20190316190352_create_account_identity_proofs.rb' - - 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' - - 'db/migrate/20190820003045_update_statuses_index.rb' - - 'db/migrate/20190823221802_add_local_index_to_statuses.rb' - - 'db/migrate/20190904222339_create_markers.rb' - - 'db/migrate/20200113125135_create_announcement_mutes.rb' - - 'db/migrate/20200114113335_create_announcement_reactions.rb' - - 'db/migrate/20200119112504_add_public_index_to_statuses.rb' - - 'db/migrate/20200628133322_create_account_notes.rb' - - 'db/migrate/20200917222316_add_index_notifications_on_type.rb' - - 'db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb' - - 'db/migrate/20220714171049_create_tag_follows.rb' - - 'db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb' - - 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb' - - 'db/post_migrate/20200917222734_remove_index_notifications_on_account_activity.rb' - - 'spec/controllers/api/v1/streaming_controller_spec.rb' - - 'spec/controllers/api/v2/admin/accounts_controller_spec.rb' - - 'spec/controllers/concerns/signature_verification_spec.rb' - - 'spec/fabricators/notification_fabricator.rb' - - 'spec/models/public_feed_spec.rb' -- cgit From 82a6cf401244e0cc51bb5fa2aa20e58b9996a640 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sat, 4 Mar 2023 18:33:52 -0500 Subject: Enable Rubocop for app/views (#23874) --- .rubocop.yml | 1 - app/views/accounts/show.rss.ruby | 12 ++++++------ app/views/tags/show.rss.ruby | 12 ++++++------ app/views/well_known/host_meta/show.xml.ruby | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index f7ed79b76..b4387a461 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -19,7 +19,6 @@ AllCops: NewCops: enable Exclude: - db/schema.rb - - 'app/views/**/*' - 'config/**/*' - 'bin/*' - 'Rakefile' diff --git a/app/views/accounts/show.rss.ruby b/app/views/accounts/show.rss.ruby index 34e29d483..7a77511ce 100644 --- a/app/views/accounts/show.rss.ruby +++ b/app/views/accounts/show.rss.ruby @@ -5,7 +5,7 @@ RSS::Builder.build do |doc| doc.image(full_asset_url(@account.avatar.url(:original)), display_name(@account), params[:tag].present? ? short_account_tag_url(@account, params[:tag]) : short_account_url(@account)) doc.last_build_date(@statuses.first.created_at) if @statuses.any? doc.icon(full_asset_url(@account.avatar.url(:original))) - doc.generator("Mastodon v#{Mastodon::Version.to_s}") + doc.generator("Mastodon v#{Mastodon::Version}") @statuses.each do |status| doc.item do |item| @@ -18,12 +18,12 @@ RSS::Builder.build do |doc| item.enclosure(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size) end - status.ordered_media_attachments.each do |media| - item.media_content(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size) do |media_content| - media_content.medium(media.gifv? ? 'image' : media.type.to_s) + status.ordered_media_attachments.each do |media_attachment| + item.media_content(full_asset_url(media_attachment.file.url(:original, false)), media_attachment.file.content_type, media_attachment.file.size) do |media_content| + media_content.medium(media_attachment.gifv? ? 'image' : media_attachment.type.to_s) media_content.rating(status.sensitive? ? 'adult' : 'nonadult') - media_content.description(media.description) if media.description.present? - media_content.thumbnail(media.thumbnail.url(:original, false)) if media.thumbnail? + media_content.description(media_attachment.description) if media_attachment.description.present? + media_content.thumbnail(media_attachment.thumbnail.url(:original, false)) if media_attachment.thumbnail? end end diff --git a/app/views/tags/show.rss.ruby b/app/views/tags/show.rss.ruby index 8e0c2327b..bbda1ad4b 100644 --- a/app/views/tags/show.rss.ruby +++ b/app/views/tags/show.rss.ruby @@ -3,7 +3,7 @@ RSS::Builder.build do |doc| doc.description(I18n.t('rss.descriptions.tag', hashtag: @tag.display_name)) doc.link(tag_url(@tag)) doc.last_build_date(@statuses.first.created_at) if @statuses.any? - doc.generator("Mastodon v#{Mastodon::Version.to_s}") + doc.generator("Mastodon v#{Mastodon::Version}") @statuses.each do |status| doc.item do |item| @@ -16,12 +16,12 @@ RSS::Builder.build do |doc| item.enclosure(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size) end - status.ordered_media_attachments.each do |media| - item.media_content(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size) do |media_content| - media_content.medium(media.gifv? ? 'image' : media.type.to_s) + status.ordered_media_attachments.each do |media_attachment| + item.media_content(full_asset_url(media_attachment.file.url(:original, false)), media_attachment.file.content_type, media_attachment.file.size) do |media_content| + media_content.medium(media_attachment.gifv? ? 'image' : media_attachment.type.to_s) media_content.rating(status.sensitive? ? 'adult' : 'nonadult') - media_content.description(media.description) if media.description.present? - media_content.thumbnail(media.thumbnail.url(:original, false)) if media.thumbnail? + media_content.description(media_attachment.description) if media_attachment.description.present? + media_content.thumbnail(media_attachment.thumbnail.url(:original, false)) if media_attachment.thumbnail? end end diff --git a/app/views/well_known/host_meta/show.xml.ruby b/app/views/well_known/host_meta/show.xml.ruby index b4e867c5f..bb5a01a1b 100644 --- a/app/views/well_known/host_meta/show.xml.ruby +++ b/app/views/well_known/host_meta/show.xml.ruby @@ -9,4 +9,4 @@ doc << Ox::Element.new('XRD').tap do |xrd| end end -('' + Ox.dump(doc, effort: :tolerant)).force_encoding('UTF-8') +"#{Ox.dump(doc, effort: :tolerant)}".force_encoding('UTF-8') -- cgit From 3ea0856f707c0b59914d616608ae15cc6d9a9e1a Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 10 Mar 2023 10:32:37 -0500 Subject: Enable RSpec/FilePath (#23965) --- .rubocop.yml | 17 +++++++++++++ .rubocop_todo.yml | 72 ------------------------------------------------------- 2 files changed, 17 insertions(+), 72 deletions(-) (limited to '.rubocop.yml') 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. -- cgit From aa947a143b5bd84865bff2b24878d84f3d69b8b7 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 15 Mar 2023 23:31:08 -0400 Subject: Regen rubocop-todo without Max shadowing (#24076) --- .rubocop.yml | 10 - .rubocop_todo.yml | 2439 ++++++++++++++++++++++++++++++++++++++++----- lib/mastodon/media_cli.rb | 2 - 3 files changed, 2201 insertions(+), 250 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 99206e597..8eb3d402e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -32,7 +32,6 @@ Layout/FirstHashElementIndentation: EnforcedStyle: consistent Layout/LineLength: - Max: 140 # RuboCop default 120 AllowedPatterns: # Allow comments to be long lines - !ruby/regexp / \# .*$/ @@ -47,13 +46,11 @@ Lint/UselessAccessModifier: - class_methods Metrics/AbcSize: - Max: 34 # RuboCop default 17 Exclude: - 'lib/**/*cli*.rb' - db/*migrate/**/* Metrics/BlockLength: - Max: 55 # Default 25 CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' @@ -63,30 +60,23 @@ Metrics/BlockNesting: - 'lib/mastodon/*_cli.rb' Metrics/ClassLength: - Max: 500 # Default 100 CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' Metrics/CyclomaticComplexity: - Max: 12 # Default 7 Exclude: - lib/mastodon/*cli*.rb - db/*migrate/**/* Metrics/MethodLength: - Max: 25 # RuboCop default 10 CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' Metrics/ModuleLength: - Max: 200 # Default 100 CountAsOne: [array, heredoc] -Metrics/PerceivedComplexity: - Max: 16 # RuboCop default 8 - Rails/HttpStatus: EnforcedStyle: numeric diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6dbcbaeba..e79f4f8e9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,11 @@ # This configuration was generated by -# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2023-02-19 06:22:09 UTC using RuboCop version 1.45.1. +# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp` +# using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 15 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemfile, **/Gemfile, **/gems.rb @@ -14,14 +13,6 @@ Bundler/OrderedGems: Exclude: - 'Gemfile' -# Offense count: 581 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. -# URISchemes: http, https -Layout/LineLength: - Enabled: false - -# Offense count: 14 # Configuration parameters: AllowedMethods, AllowedPatterns. Lint/AmbiguousBlockAssociation: Exclude: @@ -35,7 +26,6 @@ Lint/AmbiguousBlockAssociation: - 'spec/services/unsuspend_account_service_spec.rb' - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' -# Offense count: 15 # Configuration parameters: AllowedMethods. # AllowedMethods: enums Lint/ConstantDefinitionInBlock: @@ -50,7 +40,6 @@ Lint/ConstantDefinitionInBlock: - 'spec/lib/settings/extend_spec.rb' - 'spec/models/concerns/remotable_spec.rb' -# Offense count: 5 # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. Lint/DuplicateBranch: Exclude: @@ -60,7 +49,6 @@ Lint/DuplicateBranch: - 'app/validators/vote_validator.rb' - 'lib/mastodon/maintenance_cli.rb' -# Offense count: 42 # Configuration parameters: AllowComments, AllowEmptyLambdas. Lint/EmptyBlock: Exclude: @@ -68,11 +56,7 @@ Lint/EmptyBlock: - 'spec/controllers/application_controller_spec.rb' - 'spec/fabricators/access_token_fabricator.rb' - 'spec/fabricators/conversation_fabricator.rb' - - 'spec/fabricators/conversation_mute_fabricator.rb' - - 'spec/fabricators/import_fabricator.rb' - - 'spec/fabricators/setting_fabricator.rb' - 'spec/fabricators/system_key_fabricator.rb' - - 'spec/fabricators/web_setting_fabricator.rb' - 'spec/helpers/admin/action_logs_helper_spec.rb' - 'spec/lib/activitypub/adapter_spec.rb' - 'spec/models/account_alias_spec.rb' @@ -93,7 +77,6 @@ Lint/EmptyBlock: - 'spec/models/list_spec.rb' - 'spec/models/login_activity_spec.rb' - 'spec/models/mute_spec.rb' - - 'spec/models/one_time_key_spec.rb' - 'spec/models/preview_card_spec.rb' - 'spec/models/preview_card_trend_spec.rb' - 'spec/models/relay_spec.rb' @@ -107,30 +90,25 @@ Lint/EmptyBlock: - 'spec/models/user_role_spec.rb' - 'spec/models/web/setting_spec.rb' -# Offense count: 1 # Configuration parameters: AllowComments. Lint/EmptyClass: Exclude: - 'spec/controllers/api/base_controller_spec.rb' -# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Lint/NonDeterministicRequireOrder: Exclude: - 'spec/rails_helper.rb' -# Offense count: 1 Lint/NonLocalExitFromIterator: Exclude: - 'app/helpers/jsonld_helper.rb' -# Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Lint/OrAssignmentToConstant: Exclude: - 'lib/sanitize_ext/sanitize_config.rb' -# Offense count: 33 Lint/UselessAssignment: Exclude: - 'app/services/activitypub/process_status_update_service.rb' @@ -151,53 +129,46 @@ Lint/UselessAssignment: - 'spec/services/resolve_url_service_spec.rb' - 'spec/views/statuses/show.html.haml_spec.rb' -# Offense count: 3 # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - 'spec/services/resolve_account_service_spec.rb' -# Offense count: 66 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: - Enabled: false + Max: 150 -# Offense count: 10 -# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. # AllowedMethods: refine Metrics/BlockLength: - Exclude: - - 'app/models/concerns/account_interactions.rb' - - 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb' - - 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb' - - 'lib/tasks/branding.rake' - - 'lib/tasks/mastodon.rake' - - 'lib/tasks/repo.rake' - - 'lib/tasks/tests.rake' + Max: 433 -# Offense count: 1 # Configuration parameters: CountBlocks, Max. Metrics/BlockNesting: Exclude: - 'lib/tasks/mastodon.rake' -# Offense count: 39 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ClassLength: + Max: 373 + # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: - Enabled: false + Max: 25 -# Offense count: 35 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: - Enabled: false + Max: 58 -# Offense count: 1 # Configuration parameters: CountComments, Max, CountAsOne. Metrics/ModuleLength: Exclude: + - 'app/controllers/concerns/signature_verification.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/jsonld_helper.rb' + - 'app/helpers/statuses_helper.rb' - 'app/models/concerns/account_interactions.rb' -# Offense count: 5 # Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters. Metrics/ParameterLists: Exclude: @@ -206,32 +177,14 @@ Metrics/ParameterLists: - 'app/services/activitypub/fetch_remote_actor_service.rb' - 'app/services/activitypub/fetch_remote_status_service.rb' -# Offense count: 16 -# Configuration parameters: AllowedMethods, AllowedPatterns, Max. +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: - Exclude: - - 'app/helpers/jsonld_helper.rb' - - 'app/lib/feed_manager.rb' - - 'app/lib/status_cache_hydrator.rb' - - 'app/lib/user_settings_decorator.rb' - - 'app/models/trends/links.rb' - - 'app/services/activitypub/fetch_remote_key_service.rb' - - 'app/services/activitypub/fetch_remote_status_service.rb' - - 'app/services/activitypub/process_account_service.rb' - - 'app/services/fetch_link_card_service.rb' - - 'app/services/fetch_oembed_service.rb' - - 'app/services/process_mentions_service.rb' - - 'app/services/resolve_account_service.rb' - - 'lib/mastodon/accounts_cli.rb' - - 'lib/mastodon/domains_cli.rb' - - 'lib/mastodon/maintenance_cli.rb' + Max: 28 -# Offense count: 1 Naming/AccessorMethodName: Exclude: - 'app/controllers/auth/sessions_controller.rb' -# Offense count: 7 # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -243,10 +196,9 @@ Naming/MemoizedInstanceVariableName: - 'app/services/resolve_url_service.rb' - 'app/services/search_service.rb' -# Offense count: 50 # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 Naming/VariableNumber: Exclude: - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' @@ -263,7 +215,6 @@ Naming/VariableNumber: - 'spec/models/user_spec.rb' - 'spec/services/activitypub/fetch_featured_collection_service_spec.rb' -# Offense count: 12 # Configuration parameters: MinSize. Performance/CollectionLiteralInLoop: Exclude: @@ -278,14 +229,12 @@ Performance/CollectionLiteralInLoop: - 'app/services/unsuspend_account_service.rb' - 'lib/mastodon/media_cli.rb' -# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/Count: Exclude: - 'app/lib/importer/accounts_index_importer.rb' - 'app/lib/importer/tags_index_importer.rb' -# Offense count: 10 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SafeMultiline. Performance/DeletePrefix: @@ -301,7 +250,6 @@ Performance/DeletePrefix: - 'app/services/resolve_account_service.rb' - 'app/services/tag_search_service.rb' -# Offense count: 19 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/MapCompact: Exclude: @@ -321,36 +269,30 @@ Performance/MapCompact: - 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb' - 'spec/presenters/status_relationships_presenter_spec.rb' -# Offense count: 7 Performance/MethodObjectAsBlock: Exclude: - 'app/models/account_suggestions/source.rb' - 'spec/models/export_spec.rb' -# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/RedundantEqualityComparisonBlock: Exclude: - 'spec/requests/link_headers_spec.rb' -# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SafeMultiline. Performance/StartWith: Exclude: - 'app/lib/extractor.rb' -# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: OnlySumOrWithInitialValue. Performance/Sum: Exclude: - 'app/lib/activity_tracker.rb' - 'app/models/trends/history.rb' - - 'app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb' - 'lib/paperclip/color_extractor.rb' -# Offense count: 15 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/TimesMap: Exclude: @@ -360,7 +302,6 @@ Performance/TimesMap: - 'spec/lib/request_pool_spec.rb' - 'spec/models/account_spec.rb' -# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/UnfreezeString: Exclude: @@ -369,7 +310,6 @@ Performance/UnfreezeString: - 'app/validators/status_length_validator.rb' - 'lib/tasks/mastodon.rake' -# Offense count: 27 RSpec/AnyInstance: Exclude: - 'spec/controllers/activitypub/inboxes_controller_spec.rb' @@ -390,12 +330,10 @@ RSpec/AnyInstance: - 'spec/workers/activitypub/delivery_worker_spec.rb' - 'spec/workers/web/push_notification_worker_spec.rb' -# Offense count: 1 RSpec/BeforeAfterAll: Exclude: - 'spec/requests/localization_spec.rb' -# Offense count: 558 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: @@ -440,7 +378,6 @@ RSpec/ContextWording: - 'spec/lib/html_aware_formatter_spec.rb' - 'spec/lib/link_details_extractor_spec.rb' - 'spec/lib/ostatus/tag_manager_spec.rb' - - 'spec/lib/plain_text_formatter_spec.rb' - 'spec/lib/scope_transformer_spec.rb' - 'spec/lib/status_cache_hydrator_spec.rb' - 'spec/lib/status_reach_finder_spec.rb' @@ -506,7 +443,6 @@ RSpec/ContextWording: - 'spec/workers/move_worker_spec.rb' - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' -# Offense count: 339 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SkipBlocks, EnforcedStyle. # SupportedStyles: described_class, explicit @@ -581,7 +517,6 @@ RSpec/DescribedClass: - 'spec/services/update_account_service_spec.rb' - 'spec/validators/note_length_validator_spec.rb' -# Offense count: 32 # This cop supports unsafe autocorrection (--autocorrect-all). RSpec/EmptyExampleGroup: Exclude: @@ -604,7 +539,6 @@ RSpec/EmptyExampleGroup: - 'spec/models/list_spec.rb' - 'spec/models/login_activity_spec.rb' - 'spec/models/mute_spec.rb' - - 'spec/models/one_time_key_spec.rb' - 'spec/models/preview_card_spec.rb' - 'spec/models/preview_card_trend_spec.rb' - 'spec/models/relay_spec.rb' @@ -618,12 +552,10 @@ RSpec/EmptyExampleGroup: - 'spec/models/web/setting_spec.rb' - 'spec/services/unmute_service_spec.rb' -# Offense count: 178 # Configuration parameters: CountAsOne. RSpec/ExampleLength: Max: 22 -# Offense count: 21 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: method_call, block @@ -641,14 +573,12 @@ RSpec/ExpectChange: - 'spec/services/unsuspend_account_service_spec.rb' - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' -# Offense count: 5 RSpec/ExpectInHook: Exclude: - 'spec/controllers/api/v1/media_controller_spec.rb' - 'spec/controllers/settings/applications_controller_spec.rb' - 'spec/lib/status_filter_spec.rb' -# Offense count: 16 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, each, example @@ -664,7 +594,6 @@ RSpec/HookArgument: - 'spec/services/import_service_spec.rb' - 'spec/spec_helper.rb' -# Offense count: 101 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Exclude: @@ -687,7 +616,6 @@ RSpec/InstanceVariable: - 'spec/services/search_service_spec.rb' - 'spec/services/unblock_domain_service_spec.rb' -# Offense count: 15 RSpec/LeakyConstantDeclaration: Exclude: - 'spec/controllers/api/base_controller_spec.rb' @@ -700,7 +628,6 @@ RSpec/LeakyConstantDeclaration: - 'spec/lib/settings/extend_spec.rb' - 'spec/models/concerns/remotable_spec.rb' -# Offense count: 108 RSpec/LetSetup: Exclude: - 'spec/controllers/admin/accounts_controller_spec.rb' @@ -753,7 +680,6 @@ RSpec/LetSetup: - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' - 'spec/workers/scheduler/user_cleanup_scheduler_spec.rb' -# Offense count: 7 RSpec/MessageChain: Exclude: - 'spec/controllers/api/v1/media_controller_spec.rb' @@ -761,7 +687,6 @@ RSpec/MessageChain: - 'spec/models/session_activation_spec.rb' - 'spec/models/setting_spec.rb' -# Offense count: 47 # Configuration parameters: EnforcedStyle. # SupportedStyles: have_received, receive RSpec/MessageSpies: @@ -784,7 +709,6 @@ RSpec/MessageSpies: - 'spec/spec_helper.rb' - 'spec/validators/status_length_validator_spec.rb' -# Offense count: 35 RSpec/MissingExampleGroupArgument: Exclude: - 'spec/controllers/accounts_controller_spec.rb' @@ -810,16 +734,13 @@ RSpec/MissingExampleGroupArgument: - 'spec/services/notify_service_spec.rb' - 'spec/services/process_mentions_service_spec.rb' -# Offense count: 599 RSpec/MultipleExpectations: Max: 19 -# Offense count: 442 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: Max: 21 -# Offense count: 7 # This cop supports safe autocorrection (--autocorrect). RSpec/MultipleSubjects: Exclude: @@ -831,7 +752,6 @@ RSpec/MultipleSubjects: - 'spec/controllers/follower_accounts_controller_spec.rb' - 'spec/controllers/following_accounts_controller_spec.rb' -# Offense count: 1407 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only RSpec/NamedSubject: @@ -1030,12 +950,10 @@ RSpec/NamedSubject: - 'spec/workers/unfollow_follow_worker_spec.rb' - 'spec/workers/web/push_notification_worker_spec.rb' -# Offense count: 552 # Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 6 -# Offense count: 2 # Configuration parameters: AllowedPatterns. # AllowedPatterns: ^expect_, ^assert_ RSpec/NoExpectationExample: @@ -1043,13 +961,11 @@ RSpec/NoExpectationExample: - 'spec/controllers/auth/registrations_controller_spec.rb' - 'spec/services/precompute_feed_service_spec.rb' -# Offense count: 3 RSpec/PendingWithoutReason: Exclude: - 'spec/models/account_spec.rb' - 'spec/support/examples/lib/settings/scoped_settings.rb' -# Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. # SupportedStyles: inflected, explicit @@ -1059,7 +975,6 @@ RSpec/PredicateMatcher: - 'spec/models/user_spec.rb' - 'spec/services/post_status_service_spec.rb' -# Offense count: 180 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Inferences. RSpec/Rails/InferredSpecType: @@ -1166,7 +1081,6 @@ RSpec/Rails/InferredSpecType: - 'spec/helpers/formatting_helper_spec.rb' - 'spec/helpers/home_helper_spec.rb' - 'spec/helpers/routing_helper_spec.rb' - - 'spec/helpers/statuses_helper_spec.rb' - 'spec/mailers/admin_mailer_spec.rb' - 'spec/mailers/notification_mailer_spec.rb' - 'spec/mailers/user_mailer_spec.rb' @@ -1184,18 +1098,15 @@ RSpec/Rails/InferredSpecType: - 'spec/models/announcement_mute_spec.rb' - 'spec/models/announcement_reaction_spec.rb' - 'spec/models/announcement_spec.rb' - - 'spec/models/appeal_spec.rb' - 'spec/models/backup_spec.rb' - 'spec/models/block_spec.rb' - 'spec/models/canonical_email_block_spec.rb' - 'spec/models/conversation_mute_spec.rb' - 'spec/models/conversation_spec.rb' - - 'spec/models/custom_emoji_category_spec.rb' - 'spec/models/custom_emoji_spec.rb' - 'spec/models/custom_filter_keyword_spec.rb' - 'spec/models/custom_filter_spec.rb' - 'spec/models/device_spec.rb' - - 'spec/models/domain_allow_spec.rb' - 'spec/models/domain_block_spec.rb' - 'spec/models/email_domain_block_spec.rb' - 'spec/models/encrypted_message_spec.rb' @@ -1208,28 +1119,22 @@ RSpec/Rails/InferredSpecType: - 'spec/models/identity_spec.rb' - 'spec/models/import_spec.rb' - 'spec/models/invite_spec.rb' - - 'spec/models/ip_block_spec.rb' - 'spec/models/list_account_spec.rb' - 'spec/models/list_spec.rb' - 'spec/models/login_activity_spec.rb' - - 'spec/models/marker_spec.rb' - 'spec/models/media_attachment_spec.rb' - 'spec/models/mention_spec.rb' - 'spec/models/mute_spec.rb' - 'spec/models/notification_spec.rb' - - 'spec/models/one_time_key_spec.rb' - - 'spec/models/poll_spec.rb' - 'spec/models/poll_vote_spec.rb' - 'spec/models/preview_card_spec.rb' - 'spec/models/preview_card_trend_spec.rb' - 'spec/models/public_feed_spec.rb' - 'spec/models/relay_spec.rb' - - 'spec/models/rule_spec.rb' - 'spec/models/scheduled_status_spec.rb' - 'spec/models/session_activation_spec.rb' - 'spec/models/setting_spec.rb' - 'spec/models/site_upload_spec.rb' - - 'spec/models/status_edit_spec.rb' - 'spec/models/status_pin_spec.rb' - 'spec/models/status_spec.rb' - 'spec/models/status_stat_spec.rb' @@ -1245,23 +1150,19 @@ RSpec/Rails/InferredSpecType: - 'spec/models/webauthn_credentials_spec.rb' - 'spec/models/webhook_spec.rb' -# Offense count: 6 RSpec/RepeatedExample: Exclude: - 'spec/policies/status_policy_spec.rb' -# Offense count: 6 RSpec/RepeatedExampleGroupBody: Exclude: - 'spec/controllers/statuses_controller_spec.rb' -# Offense count: 4 RSpec/RepeatedExampleGroupDescription: Exclude: - 'spec/controllers/admin/reports/actions_controller_spec.rb' - 'spec/policies/report_note_policy_spec.rb' -# Offense count: 12 RSpec/ScatteredSetup: Exclude: - 'spec/controllers/activitypub/followers_synchronizations_controller_spec.rb' @@ -1269,15 +1170,12 @@ RSpec/ScatteredSetup: - 'spec/controllers/admin/disputes/appeals_controller_spec.rb' - 'spec/controllers/auth/registrations_controller_spec.rb' - 'spec/services/activitypub/process_account_service_spec.rb' - - 'spec/services/fetch_resource_service_spec.rb' -# Offense count: 1 # This cop supports safe autocorrection (--autocorrect). RSpec/SharedContext: Exclude: - 'spec/services/unsuspend_account_service_spec.rb' -# Offense count: 16 RSpec/StubbedMock: Exclude: - 'spec/controllers/api/base_controller_spec.rb' @@ -1289,7 +1187,6 @@ RSpec/StubbedMock: - 'spec/lib/webfinger_resource_spec.rb' - 'spec/services/activitypub/process_collection_service_spec.rb' -# Offense count: 22 RSpec/SubjectDeclaration: Exclude: - 'spec/controllers/admin/domain_blocks_controller_spec.rb' @@ -1314,13 +1211,11 @@ RSpec/SubjectDeclaration: - 'spec/policies/user_policy_spec.rb' - 'spec/services/activitypub/process_account_service_spec.rb' -# Offense count: 5 RSpec/SubjectStub: Exclude: - 'spec/services/unallow_domain_service_spec.rb' - 'spec/validators/blacklisted_email_validator_spec.rb' -# Offense count: 119 # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. RSpec/VerifiedDoubles: Exclude: @@ -1361,7 +1256,6 @@ RSpec/VerifiedDoubles: - 'spec/workers/feed_insert_worker_spec.rb' - 'spec/workers/regeneration_worker_spec.rb' -# Offense count: 19 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: ExpectedOrder, Include. # ExpectedOrder: index, show, new, edit, create, update, destroy @@ -1388,7 +1282,6 @@ Rails/ActionOrder: - 'app/controllers/settings/applications_controller.rb' - 'app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb' -# Offense count: 7 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Include. # Include: app/models/**/*.rb @@ -1402,7 +1295,6 @@ Rails/ActiveRecordCallbacksOrder: - 'app/models/session_activation.rb' - 'app/models/status.rb' -# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationController: Exclude: @@ -1411,7 +1303,6 @@ Rails/ApplicationController: - 'app/controllers/well_known/nodeinfo_controller.rb' - 'app/controllers/well_known/webfinger_controller.rb' -# Offense count: 35 # Configuration parameters: Database, Include. # SupportedDatabases: mysql, postgresql # Include: db/migrate/*.rb @@ -1449,7 +1340,6 @@ Rails/BulkChangeTable: - 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' - 'db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb' -# Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/CompactBlank: Exclude: @@ -1460,14 +1350,12 @@ Rails/CompactBlank: - 'app/models/user.rb' - 'app/services/import_service.rb' -# Offense count: 3 # This cop supports safe autocorrection (--autocorrect). Rails/ContentTag: Exclude: - 'app/helpers/application_helper.rb' - 'app/helpers/branding_helper.rb' -# Offense count: 8 # Configuration parameters: Include. # Include: db/migrate/*.rb Rails/CreateTableWithTimestamps: @@ -1481,22 +1369,17 @@ Rails/CreateTableWithTimestamps: - 'db/migrate/20220824233535_create_status_trends.rb' - 'db/migrate/20221006061337_create_preview_card_trends.rb' -# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/DeprecatedActiveModelErrorsMethods: Exclude: - - 'app/validators/ed25519_key_validator.rb' - - 'app/validators/ed25519_signature_validator.rb' - 'lib/mastodon/accounts_cli.rb' -# Offense count: 4 # This cop supports safe autocorrection (--autocorrect). Rails/DuplicateAssociation: Exclude: - 'app/serializers/activitypub/collection_serializer.rb' - 'app/serializers/activitypub/note_serializer.rb' -# Offense count: 76 # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: @@ -1564,7 +1447,6 @@ Rails/FilePath: - 'spec/rails_helper.rb' - 'spec/spec_helper.rb' -# Offense count: 6 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasAndBelongsToMany: @@ -1574,7 +1456,6 @@ Rails/HasAndBelongsToMany: - 'app/models/status.rb' - 'app/models/tag.rb' -# Offense count: 15 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: @@ -1589,7 +1470,6 @@ Rails/HasManyOrHasOneDependent: - 'app/models/user.rb' - 'app/models/web/push_subscription.rb' -# Offense count: 4 # Configuration parameters: Include. # Include: app/helpers/**/*.rb Rails/HelperInstanceVariable: @@ -1598,7 +1478,6 @@ Rails/HelperInstanceVariable: - 'app/helpers/instance_helper.rb' - 'app/helpers/jsonld_helper.rb' -# Offense count: 3 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Include. # Include: spec/**/*, test/**/* @@ -1606,7 +1485,6 @@ Rails/HttpPositionalArguments: Exclude: - 'spec/config/initializers/rack_attack_spec.rb' -# Offense count: 7 # Configuration parameters: Include. # Include: spec/**/*.rb, test/**/*.rb Rails/I18nLocaleAssignment: @@ -1615,13 +1493,11 @@ Rails/I18nLocaleAssignment: - 'spec/helpers/application_helper_spec.rb' - 'spec/requests/localization_spec.rb' -# Offense count: 6 Rails/I18nLocaleTexts: Exclude: - 'lib/tasks/mastodon.rake' - 'spec/helpers/flashes_helper_spec.rb' -# Offense count: 8 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/IgnoredColumnsAssignment: Exclude: @@ -1634,7 +1510,6 @@ Rails/IgnoredColumnsAssignment: - 'app/models/status_edit.rb' - 'app/models/user.rb' -# Offense count: 25 # Configuration parameters: IgnoreScopes, Include. # Include: app/models/**/*.rb Rails/InverseOf: @@ -1647,9 +1522,7 @@ Rails/InverseOf: - 'app/models/instance.rb' - 'app/models/notification.rb' - 'app/models/status.rb' - - 'app/models/user_ip.rb' -# Offense count: 13 # Configuration parameters: Include. # Include: app/controllers/**/*.rb, app/mailers/**/*.rb Rails/LexicallyScopedActionFilter: @@ -1660,7 +1533,6 @@ Rails/LexicallyScopedActionFilter: - 'app/controllers/auth/registrations_controller.rb' - 'app/controllers/auth/sessions_controller.rb' -# Offense count: 18 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/NegateInclude: Exclude: @@ -1680,7 +1552,6 @@ Rails/NegateInclude: - 'app/workers/web/push_notification_worker.rb' - 'lib/paperclip/color_extractor.rb' -# Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. # Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb @@ -1688,7 +1559,6 @@ Rails/Output: Exclude: - 'lib/mastodon/ip_blocks_cli.rb' -# Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. # Include: **/Rakefile, **/*.rake @@ -1701,7 +1571,6 @@ Rails/RakeEnvironment: - 'lib/tasks/repo.rake' - 'lib/tasks/statistics.rake' -# Offense count: 29 # Configuration parameters: Include. # Include: db/**/*.rb Rails/ReversibleMigration: @@ -1720,7 +1589,6 @@ Rails/ReversibleMigration: - 'db/migrate/20180617162849_remove_unused_indexes.rb' - 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' -# Offense count: 141 # Configuration parameters: ForbiddenMethods, AllowedMethods. # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all Rails/SkipsModelValidations: @@ -1774,7 +1642,6 @@ Rails/SkipsModelValidations: - 'spec/services/follow_service_spec.rb' - 'spec/services/update_account_service_spec.rb' -# Offense count: 11 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/SquishedSQLHeredocs: Exclude: @@ -1784,7 +1651,6 @@ Rails/SquishedSQLHeredocs: - 'lib/mastodon/snowflake.rb' - 'lib/tasks/tests.rake' -# Offense count: 7 Rails/TransactionExitStatement: Exclude: - 'app/lib/activitypub/activity/announce.rb' @@ -1792,7 +1658,6 @@ Rails/TransactionExitStatement: - 'app/lib/activitypub/activity/delete.rb' - 'app/services/activitypub/process_account_service.rb' -# Offense count: 4 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/UniqueValidationWithoutIndex: @@ -1802,7 +1667,6 @@ Rails/UniqueValidationWithoutIndex: - 'app/models/identity.rb' - 'app/models/webauthn_credential.rb' -# Offense count: 19 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/UnusedIgnoredColumns: @@ -1816,7 +1680,6 @@ Rails/UnusedIgnoredColumns: - 'app/models/status_edit.rb' - 'app/models/user.rb' -# Offense count: 61 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: exists, where @@ -1856,24 +1719,461 @@ Rails/WhereExists: - 'spec/services/purge_domain_service_spec.rb' - 'spec/services/unallow_domain_service_spec.rb' -# Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: MinBranchesCount. Style/CaseLikeIf: Exclude: - - 'app/controllers/authorize_interactions_controller.rb' - 'app/controllers/concerns/signature_verification.rb' - - 'app/helpers/jsonld_helper.rb' - - 'app/models/account.rb' - - 'app/services/resolve_url_service.rb' -# Offense count: 445 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: - Enabled: false + Exclude: + - 'app/controllers/activitypub/base_controller.rb' + - 'app/controllers/activitypub/claims_controller.rb' + - 'app/controllers/activitypub/collections_controller.rb' + - 'app/controllers/activitypub/followers_synchronizations_controller.rb' + - 'app/controllers/activitypub/inboxes_controller.rb' + - 'app/controllers/activitypub/outboxes_controller.rb' + - 'app/controllers/activitypub/replies_controller.rb' + - 'app/controllers/admin/announcements_controller.rb' + - 'app/controllers/admin/disputes/appeals_controller.rb' + - 'app/controllers/admin/domain_allows_controller.rb' + - 'app/controllers/admin/reports/actions_controller.rb' + - 'app/controllers/admin/settings/about_controller.rb' + - 'app/controllers/admin/settings/appearance_controller.rb' + - 'app/controllers/admin/settings/branding_controller.rb' + - 'app/controllers/admin/settings/content_retention_controller.rb' + - 'app/controllers/admin/settings/discovery_controller.rb' + - 'app/controllers/admin/settings/registrations_controller.rb' + - 'app/controllers/admin/trends/links/preview_card_providers_controller.rb' + - 'app/controllers/admin/trends/links_controller.rb' + - 'app/controllers/admin/trends/statuses_controller.rb' + - 'app/controllers/admin/trends/tags_controller.rb' + - 'app/controllers/admin/users/roles_controller.rb' + - 'app/controllers/admin/users/two_factor_authentications_controller.rb' + - 'app/controllers/admin/webhooks/secrets_controller.rb' + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/api/oembed_controller.rb' + - 'app/controllers/api/v1/accounts/credentials_controller.rb' + - 'app/controllers/api/v1/accounts/familiar_followers_controller.rb' + - 'app/controllers/api/v1/accounts/featured_tags_controller.rb' + - 'app/controllers/api/v1/accounts/follower_accounts_controller.rb' + - 'app/controllers/api/v1/accounts/following_accounts_controller.rb' + - 'app/controllers/api/v1/accounts/identity_proofs_controller.rb' + - 'app/controllers/api/v1/accounts/lists_controller.rb' + - 'app/controllers/api/v1/accounts/lookup_controller.rb' + - 'app/controllers/api/v1/accounts/notes_controller.rb' + - 'app/controllers/api/v1/accounts/pins_controller.rb' + - 'app/controllers/api/v1/accounts/relationships_controller.rb' + - 'app/controllers/api/v1/accounts/search_controller.rb' + - 'app/controllers/api/v1/accounts/statuses_controller.rb' + - 'app/controllers/api/v1/accounts_controller.rb' + - 'app/controllers/api/v1/admin/account_actions_controller.rb' + - 'app/controllers/api/v1/admin/accounts_controller.rb' + - 'app/controllers/api/v1/admin/canonical_email_blocks_controller.rb' + - 'app/controllers/api/v1/admin/dimensions_controller.rb' + - 'app/controllers/api/v1/admin/domain_allows_controller.rb' + - 'app/controllers/api/v1/admin/domain_blocks_controller.rb' + - 'app/controllers/api/v1/admin/email_domain_blocks_controller.rb' + - 'app/controllers/api/v1/admin/ip_blocks_controller.rb' + - 'app/controllers/api/v1/admin/measures_controller.rb' + - 'app/controllers/api/v1/admin/reports_controller.rb' + - 'app/controllers/api/v1/admin/retention_controller.rb' + - 'app/controllers/api/v1/admin/trends/links_controller.rb' + - 'app/controllers/api/v1/admin/trends/statuses_controller.rb' + - 'app/controllers/api/v1/admin/trends/tags_controller.rb' + - 'app/controllers/api/v1/announcements/reactions_controller.rb' + - 'app/controllers/api/v1/announcements_controller.rb' + - 'app/controllers/api/v1/apps/credentials_controller.rb' + - 'app/controllers/api/v1/apps_controller.rb' + - 'app/controllers/api/v1/blocks_controller.rb' + - 'app/controllers/api/v1/bookmarks_controller.rb' + - 'app/controllers/api/v1/conversations_controller.rb' + - 'app/controllers/api/v1/crypto/deliveries_controller.rb' + - 'app/controllers/api/v1/crypto/encrypted_messages_controller.rb' + - 'app/controllers/api/v1/crypto/keys/claims_controller.rb' + - 'app/controllers/api/v1/crypto/keys/counts_controller.rb' + - 'app/controllers/api/v1/crypto/keys/queries_controller.rb' + - 'app/controllers/api/v1/crypto/keys/uploads_controller.rb' + - 'app/controllers/api/v1/custom_emojis_controller.rb' + - 'app/controllers/api/v1/directories_controller.rb' + - 'app/controllers/api/v1/domain_blocks_controller.rb' + - 'app/controllers/api/v1/emails/confirmations_controller.rb' + - 'app/controllers/api/v1/endorsements_controller.rb' + - 'app/controllers/api/v1/favourites_controller.rb' + - 'app/controllers/api/v1/featured_tags/suggestions_controller.rb' + - 'app/controllers/api/v1/featured_tags_controller.rb' + - 'app/controllers/api/v1/filters_controller.rb' + - 'app/controllers/api/v1/follow_requests_controller.rb' + - 'app/controllers/api/v1/followed_tags_controller.rb' + - 'app/controllers/api/v1/instances/activity_controller.rb' + - 'app/controllers/api/v1/instances/domain_blocks_controller.rb' + - 'app/controllers/api/v1/instances/extended_descriptions_controller.rb' + - 'app/controllers/api/v1/instances/peers_controller.rb' + - 'app/controllers/api/v1/instances/privacy_policies_controller.rb' + - 'app/controllers/api/v1/instances/rules_controller.rb' + - 'app/controllers/api/v1/instances_controller.rb' + - 'app/controllers/api/v1/lists/accounts_controller.rb' + - 'app/controllers/api/v1/lists_controller.rb' + - 'app/controllers/api/v1/markers_controller.rb' + - 'app/controllers/api/v1/media_controller.rb' + - 'app/controllers/api/v1/mutes_controller.rb' + - 'app/controllers/api/v1/notifications_controller.rb' + - 'app/controllers/api/v1/polls/votes_controller.rb' + - 'app/controllers/api/v1/polls_controller.rb' + - 'app/controllers/api/v1/preferences_controller.rb' + - 'app/controllers/api/v1/push/subscriptions_controller.rb' + - 'app/controllers/api/v1/reports_controller.rb' + - 'app/controllers/api/v1/scheduled_statuses_controller.rb' + - 'app/controllers/api/v1/statuses/bookmarks_controller.rb' + - 'app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb' + - 'app/controllers/api/v1/statuses/favourites_controller.rb' + - 'app/controllers/api/v1/statuses/histories_controller.rb' + - 'app/controllers/api/v1/statuses/mutes_controller.rb' + - 'app/controllers/api/v1/statuses/pins_controller.rb' + - 'app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb' + - 'app/controllers/api/v1/statuses/reblogs_controller.rb' + - 'app/controllers/api/v1/statuses/sources_controller.rb' + - 'app/controllers/api/v1/statuses/translations_controller.rb' + - 'app/controllers/api/v1/statuses_controller.rb' + - 'app/controllers/api/v1/streaming_controller.rb' + - 'app/controllers/api/v1/suggestions_controller.rb' + - 'app/controllers/api/v1/tags_controller.rb' + - 'app/controllers/api/v1/timelines/home_controller.rb' + - 'app/controllers/api/v1/timelines/list_controller.rb' + - 'app/controllers/api/v1/timelines/public_controller.rb' + - 'app/controllers/api/v1/timelines/tag_controller.rb' + - 'app/controllers/api/v1/trends/links_controller.rb' + - 'app/controllers/api/v1/trends/statuses_controller.rb' + - 'app/controllers/api/v1/trends/tags_controller.rb' + - 'app/controllers/api/v2/admin/accounts_controller.rb' + - 'app/controllers/api/v2/filters/keywords_controller.rb' + - 'app/controllers/api/v2/filters/statuses_controller.rb' + - 'app/controllers/api/v2/filters_controller.rb' + - 'app/controllers/api/v2/instances_controller.rb' + - 'app/controllers/api/v2/media_controller.rb' + - 'app/controllers/api/v2/search_controller.rb' + - 'app/controllers/api/v2/suggestions_controller.rb' + - 'app/controllers/api/web/base_controller.rb' + - 'app/controllers/api/web/embeds_controller.rb' + - 'app/controllers/api/web/push_subscriptions_controller.rb' + - 'app/controllers/api/web/settings_controller.rb' + - 'app/controllers/auth/challenges_controller.rb' + - 'app/controllers/auth/confirmations_controller.rb' + - 'app/controllers/auth/omniauth_callbacks_controller.rb' + - 'app/controllers/auth/passwords_controller.rb' + - 'app/controllers/auth/registrations_controller.rb' + - 'app/controllers/auth/sessions_controller.rb' + - 'app/controllers/auth/setup_controller.rb' + - 'app/controllers/disputes/appeals_controller.rb' + - 'app/controllers/disputes/base_controller.rb' + - 'app/controllers/disputes/strikes_controller.rb' + - 'app/controllers/filters/statuses_controller.rb' + - 'app/controllers/oauth/authorizations_controller.rb' + - 'app/controllers/oauth/authorized_applications_controller.rb' + - 'app/controllers/oauth/tokens_controller.rb' + - 'app/controllers/settings/aliases_controller.rb' + - 'app/controllers/settings/applications_controller.rb' + - 'app/controllers/settings/base_controller.rb' + - 'app/controllers/settings/deletes_controller.rb' + - 'app/controllers/settings/exports_controller.rb' + - 'app/controllers/settings/featured_tags_controller.rb' + - 'app/controllers/settings/imports_controller.rb' + - 'app/controllers/settings/login_activities_controller.rb' + - 'app/controllers/settings/migration/redirects_controller.rb' + - 'app/controllers/settings/migrations_controller.rb' + - 'app/controllers/settings/preferences/appearance_controller.rb' + - 'app/controllers/settings/preferences/notifications_controller.rb' + - 'app/controllers/settings/preferences/other_controller.rb' + - 'app/controllers/settings/preferences_controller.rb' + - 'app/controllers/settings/profiles_controller.rb' + - 'app/controllers/settings/sessions_controller.rb' + - 'app/helpers/admin/account_moderation_notes_helper.rb' + - 'app/helpers/admin/action_logs_helper.rb' + - 'app/helpers/admin/dashboard_helper.rb' + - 'app/helpers/admin/filter_helper.rb' + - 'app/helpers/admin/settings_helper.rb' + - 'app/helpers/admin/trends/statuses_helper.rb' + - 'app/lib/activitypub/activity.rb' + - 'app/lib/activitypub/activity/accept.rb' + - 'app/lib/activitypub/activity/add.rb' + - 'app/lib/activitypub/activity/announce.rb' + - 'app/lib/activitypub/activity/block.rb' + - 'app/lib/activitypub/activity/create.rb' + - 'app/lib/activitypub/activity/delete.rb' + - 'app/lib/activitypub/activity/flag.rb' + - 'app/lib/activitypub/activity/follow.rb' + - 'app/lib/activitypub/activity/like.rb' + - 'app/lib/activitypub/activity/move.rb' + - 'app/lib/activitypub/activity/reject.rb' + - 'app/lib/activitypub/activity/remove.rb' + - 'app/lib/activitypub/activity/undo.rb' + - 'app/lib/activitypub/activity/update.rb' + - 'app/lib/activitypub/adapter.rb' + - 'app/lib/activitypub/case_transform.rb' + - 'app/lib/activitypub/dereferencer.rb' + - 'app/lib/activitypub/forwarder.rb' + - 'app/lib/activitypub/linked_data_signature.rb' + - 'app/lib/activitypub/parser/custom_emoji_parser.rb' + - 'app/lib/activitypub/parser/media_attachment_parser.rb' + - 'app/lib/activitypub/parser/poll_parser.rb' + - 'app/lib/activitypub/parser/status_parser.rb' + - 'app/lib/activitypub/serializer.rb' + - 'app/lib/activitypub/tag_manager.rb' + - 'app/lib/admin/metrics/dimension.rb' + - 'app/lib/admin/metrics/dimension/base_dimension.rb' + - 'app/lib/admin/metrics/dimension/instance_accounts_dimension.rb' + - 'app/lib/admin/metrics/dimension/instance_languages_dimension.rb' + - 'app/lib/admin/metrics/dimension/languages_dimension.rb' + - 'app/lib/admin/metrics/dimension/servers_dimension.rb' + - 'app/lib/admin/metrics/dimension/software_versions_dimension.rb' + - 'app/lib/admin/metrics/dimension/sources_dimension.rb' + - 'app/lib/admin/metrics/dimension/space_usage_dimension.rb' + - 'app/lib/admin/metrics/dimension/tag_languages_dimension.rb' + - 'app/lib/admin/metrics/dimension/tag_servers_dimension.rb' + - 'app/lib/admin/metrics/measure.rb' + - 'app/lib/admin/metrics/measure/active_users_measure.rb' + - 'app/lib/admin/metrics/measure/base_measure.rb' + - 'app/lib/admin/metrics/measure/instance_accounts_measure.rb' + - 'app/lib/admin/metrics/measure/instance_followers_measure.rb' + - 'app/lib/admin/metrics/measure/instance_follows_measure.rb' + - 'app/lib/admin/metrics/measure/instance_media_attachments_measure.rb' + - 'app/lib/admin/metrics/measure/instance_reports_measure.rb' + - 'app/lib/admin/metrics/measure/instance_statuses_measure.rb' + - 'app/lib/admin/metrics/measure/interactions_measure.rb' + - 'app/lib/admin/metrics/measure/new_users_measure.rb' + - 'app/lib/admin/metrics/measure/opened_reports_measure.rb' + - 'app/lib/admin/metrics/measure/resolved_reports_measure.rb' + - 'app/lib/admin/metrics/measure/tag_accounts_measure.rb' + - 'app/lib/admin/metrics/measure/tag_servers_measure.rb' + - 'app/lib/admin/metrics/measure/tag_uses_measure.rb' + - 'app/lib/admin/metrics/retention.rb' + - 'app/lib/admin/system_check.rb' + - 'app/lib/admin/system_check/base_check.rb' + - 'app/lib/admin/system_check/database_schema_check.rb' + - 'app/lib/admin/system_check/elasticsearch_check.rb' + - 'app/lib/admin/system_check/message.rb' + - 'app/lib/admin/system_check/rules_check.rb' + - 'app/lib/admin/system_check/sidekiq_process_check.rb' + - 'app/lib/connection_pool/shared_connection_pool.rb' + - 'app/lib/connection_pool/shared_timed_stack.rb' + - 'app/lib/importer/accounts_index_importer.rb' + - 'app/lib/importer/base_importer.rb' + - 'app/lib/importer/statuses_index_importer.rb' + - 'app/lib/importer/tags_index_importer.rb' + - 'app/lib/nodeinfo/adapter.rb' + - 'app/lib/ostatus/tag_manager.rb' + - 'app/lib/request.rb' + - 'app/lib/rss/builder.rb' + - 'app/lib/rss/channel.rb' + - 'app/lib/rss/element.rb' + - 'app/lib/rss/item.rb' + - 'app/lib/rss/media_content.rb' + - 'app/lib/translation_service/deepl.rb' + - 'app/lib/translation_service/libre_translate.rb' + - 'app/lib/translation_service/translation.rb' + - 'app/lib/vacuum/access_tokens_vacuum.rb' + - 'app/lib/vacuum/backups_vacuum.rb' + - 'app/lib/vacuum/feeds_vacuum.rb' + - 'app/lib/vacuum/media_attachments_vacuum.rb' + - 'app/lib/vacuum/preview_cards_vacuum.rb' + - 'app/lib/vacuum/statuses_vacuum.rb' + - 'app/lib/vacuum/system_keys_vacuum.rb' + - 'app/models/account/field.rb' + - 'app/models/account_suggestions/global_source.rb' + - 'app/models/account_suggestions/past_interactions_source.rb' + - 'app/models/account_suggestions/setting_source.rb' + - 'app/models/account_suggestions/source.rb' + - 'app/models/account_suggestions/suggestion.rb' + - 'app/models/admin/account_action.rb' + - 'app/models/admin/action_log.rb' + - 'app/models/admin/action_log_filter.rb' + - 'app/models/admin/appeal_filter.rb' + - 'app/models/admin/import.rb' + - 'app/models/admin/status_batch_action.rb' + - 'app/models/admin/status_filter.rb' + - 'app/models/form/account_batch.rb' + - 'app/models/form/admin_settings.rb' + - 'app/models/form/challenge.rb' + - 'app/models/form/custom_emoji_batch.rb' + - 'app/models/form/delete_confirmation.rb' + - 'app/models/form/domain_block_batch.rb' + - 'app/models/form/email_domain_block_batch.rb' + - 'app/models/form/ip_block_batch.rb' + - 'app/models/form/redirect.rb' + - 'app/models/form/status_filter_batch_action.rb' + - 'app/models/form/two_factor_confirmation.rb' + - 'app/models/trends/base.rb' + - 'app/models/trends/history.rb' + - 'app/models/trends/links.rb' + - 'app/models/trends/preview_card_batch.rb' + - 'app/models/trends/preview_card_filter.rb' + - 'app/models/trends/preview_card_provider_batch.rb' + - 'app/models/trends/preview_card_provider_filter.rb' + - 'app/models/trends/query.rb' + - 'app/models/trends/status_batch.rb' + - 'app/models/trends/status_filter.rb' + - 'app/models/trends/statuses.rb' + - 'app/models/trends/tag_batch.rb' + - 'app/models/trends/tag_filter.rb' + - 'app/models/trends/tags.rb' + - 'app/models/web/push_subscription.rb' + - 'app/models/web/setting.rb' + - 'app/policies/admin/status_policy.rb' + - 'app/presenters/activitypub/activity_presenter.rb' + - 'app/presenters/activitypub/collection_presenter.rb' + - 'app/presenters/webhooks/event_presenter.rb' + - 'app/serializers/activitypub/accept_follow_serializer.rb' + - 'app/serializers/activitypub/activity_serializer.rb' + - 'app/serializers/activitypub/actor_serializer.rb' + - 'app/serializers/activitypub/add_serializer.rb' + - 'app/serializers/activitypub/block_serializer.rb' + - 'app/serializers/activitypub/collection_serializer.rb' + - 'app/serializers/activitypub/delete_actor_serializer.rb' + - 'app/serializers/activitypub/delete_serializer.rb' + - 'app/serializers/activitypub/device_serializer.rb' + - 'app/serializers/activitypub/emoji_serializer.rb' + - 'app/serializers/activitypub/encrypted_message_serializer.rb' + - 'app/serializers/activitypub/flag_serializer.rb' + - 'app/serializers/activitypub/follow_serializer.rb' + - 'app/serializers/activitypub/hashtag_serializer.rb' + - 'app/serializers/activitypub/image_serializer.rb' + - 'app/serializers/activitypub/like_serializer.rb' + - 'app/serializers/activitypub/move_serializer.rb' + - 'app/serializers/activitypub/note_serializer.rb' + - 'app/serializers/activitypub/one_time_key_serializer.rb' + - 'app/serializers/activitypub/outbox_serializer.rb' + - 'app/serializers/activitypub/public_key_serializer.rb' + - 'app/serializers/activitypub/reject_follow_serializer.rb' + - 'app/serializers/activitypub/remove_serializer.rb' + - 'app/serializers/activitypub/undo_announce_serializer.rb' + - 'app/serializers/activitypub/undo_block_serializer.rb' + - 'app/serializers/activitypub/undo_follow_serializer.rb' + - 'app/serializers/activitypub/undo_like_serializer.rb' + - 'app/serializers/activitypub/update_poll_serializer.rb' + - 'app/serializers/activitypub/update_serializer.rb' + - 'app/serializers/activitypub/vote_serializer.rb' + - 'app/serializers/nodeinfo/discovery_serializer.rb' + - 'app/serializers/nodeinfo/serializer.rb' + - 'app/serializers/rest/account_serializer.rb' + - 'app/serializers/rest/admin/account_serializer.rb' + - 'app/serializers/rest/admin/canonical_email_block_serializer.rb' + - 'app/serializers/rest/admin/cohort_serializer.rb' + - 'app/serializers/rest/admin/dimension_serializer.rb' + - 'app/serializers/rest/admin/domain_allow_serializer.rb' + - 'app/serializers/rest/admin/domain_block_serializer.rb' + - 'app/serializers/rest/admin/email_domain_block_serializer.rb' + - 'app/serializers/rest/admin/existing_domain_block_error_serializer.rb' + - 'app/serializers/rest/admin/ip_block_serializer.rb' + - 'app/serializers/rest/admin/ip_serializer.rb' + - 'app/serializers/rest/admin/measure_serializer.rb' + - 'app/serializers/rest/admin/report_serializer.rb' + - 'app/serializers/rest/admin/tag_serializer.rb' + - 'app/serializers/rest/admin/webhook_event_serializer.rb' + - 'app/serializers/rest/announcement_serializer.rb' + - 'app/serializers/rest/application_serializer.rb' + - 'app/serializers/rest/context_serializer.rb' + - 'app/serializers/rest/conversation_serializer.rb' + - 'app/serializers/rest/credential_account_serializer.rb' + - 'app/serializers/rest/custom_emoji_serializer.rb' + - 'app/serializers/rest/domain_block_serializer.rb' + - 'app/serializers/rest/encrypted_message_serializer.rb' + - 'app/serializers/rest/extended_description_serializer.rb' + - 'app/serializers/rest/familiar_followers_serializer.rb' + - 'app/serializers/rest/featured_tag_serializer.rb' + - 'app/serializers/rest/filter_keyword_serializer.rb' + - 'app/serializers/rest/filter_result_serializer.rb' + - 'app/serializers/rest/filter_serializer.rb' + - 'app/serializers/rest/filter_status_serializer.rb' + - 'app/serializers/rest/instance_serializer.rb' + - 'app/serializers/rest/keys/claim_result_serializer.rb' + - 'app/serializers/rest/keys/device_serializer.rb' + - 'app/serializers/rest/keys/query_result_serializer.rb' + - 'app/serializers/rest/list_serializer.rb' + - 'app/serializers/rest/marker_serializer.rb' + - 'app/serializers/rest/media_attachment_serializer.rb' + - 'app/serializers/rest/muted_account_serializer.rb' + - 'app/serializers/rest/notification_serializer.rb' + - 'app/serializers/rest/poll_serializer.rb' + - 'app/serializers/rest/preferences_serializer.rb' + - 'app/serializers/rest/preview_card_serializer.rb' + - 'app/serializers/rest/privacy_policy_serializer.rb' + - 'app/serializers/rest/reaction_serializer.rb' + - 'app/serializers/rest/relationship_serializer.rb' + - 'app/serializers/rest/report_serializer.rb' + - 'app/serializers/rest/role_serializer.rb' + - 'app/serializers/rest/rule_serializer.rb' + - 'app/serializers/rest/scheduled_status_serializer.rb' + - 'app/serializers/rest/search_serializer.rb' + - 'app/serializers/rest/status_edit_serializer.rb' + - 'app/serializers/rest/status_serializer.rb' + - 'app/serializers/rest/status_source_serializer.rb' + - 'app/serializers/rest/suggestion_serializer.rb' + - 'app/serializers/rest/tag_serializer.rb' + - 'app/serializers/rest/translation_serializer.rb' + - 'app/serializers/rest/trends/link_serializer.rb' + - 'app/serializers/rest/v1/filter_serializer.rb' + - 'app/serializers/rest/v1/instance_serializer.rb' + - 'app/serializers/rest/web_push_subscription_serializer.rb' + - 'app/serializers/web/notification_serializer.rb' + - 'app/services/activitypub/fetch_featured_collection_service.rb' + - 'app/services/activitypub/fetch_featured_tags_collection_service.rb' + - 'app/services/activitypub/fetch_remote_account_service.rb' + - 'app/services/activitypub/fetch_remote_actor_service.rb' + - 'app/services/activitypub/fetch_remote_key_service.rb' + - 'app/services/activitypub/fetch_remote_poll_service.rb' + - 'app/services/activitypub/fetch_remote_status_service.rb' + - 'app/services/activitypub/fetch_replies_service.rb' + - 'app/services/activitypub/prepare_followers_synchronization_service.rb' + - 'app/services/activitypub/process_account_service.rb' + - 'app/services/activitypub/process_collection_service.rb' + - 'app/services/activitypub/process_status_update_service.rb' + - 'app/services/activitypub/synchronize_followers_service.rb' + - 'app/services/keys/claim_service.rb' + - 'app/services/keys/query_service.rb' + - 'app/workers/activitypub/account_raw_distribution_worker.rb' + - 'app/workers/activitypub/delivery_worker.rb' + - 'app/workers/activitypub/distribute_poll_update_worker.rb' + - 'app/workers/activitypub/distribution_worker.rb' + - 'app/workers/activitypub/fetch_replies_worker.rb' + - 'app/workers/activitypub/followers_synchronization_worker.rb' + - 'app/workers/activitypub/low_priority_delivery_worker.rb' + - 'app/workers/activitypub/migrated_follow_delivery_worker.rb' + - 'app/workers/activitypub/move_distribution_worker.rb' + - 'app/workers/activitypub/post_upgrade_worker.rb' + - 'app/workers/activitypub/processing_worker.rb' + - 'app/workers/activitypub/raw_distribution_worker.rb' + - 'app/workers/activitypub/status_update_distribution_worker.rb' + - 'app/workers/activitypub/synchronize_featured_collection_worker.rb' + - 'app/workers/activitypub/synchronize_featured_tags_collection_worker.rb' + - 'app/workers/activitypub/update_distribution_worker.rb' + - 'app/workers/admin/account_deletion_worker.rb' + - 'app/workers/admin/domain_purge_worker.rb' + - 'app/workers/admin/suspension_worker.rb' + - 'app/workers/admin/unsuspension_worker.rb' + - 'app/workers/import/relationship_worker.rb' + - 'app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb' + - 'app/workers/scheduler/follow_recommendations_scheduler.rb' + - 'app/workers/scheduler/indexing_scheduler.rb' + - 'app/workers/scheduler/instance_refresh_scheduler.rb' + - 'app/workers/scheduler/ip_cleanup_scheduler.rb' + - 'app/workers/scheduler/pghero_scheduler.rb' + - 'app/workers/scheduler/scheduled_statuses_scheduler.rb' + - 'app/workers/scheduler/suspended_user_cleanup_scheduler.rb' + - 'app/workers/scheduler/trends/refresh_scheduler.rb' + - 'app/workers/scheduler/trends/review_notifications_scheduler.rb' + - 'app/workers/scheduler/user_cleanup_scheduler.rb' + - 'app/workers/scheduler/vacuum_scheduler.rb' + - 'app/workers/web/push_notification_worker.rb' + - 'app/workers/webhooks/delivery_worker.rb' + - 'lib/mastodon/rack_middleware.rb' + - 'lib/mastodon/sidekiq_middleware.rb' + - 'lib/mastodon/snowflake.rb' + - 'lib/webpacker/helper_extensions.rb' + - 'lib/webpacker/manifest_extensions.rb' -# Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedMethods, AllowedPatterns. # AllowedMethods: ==, equal?, eql? @@ -1882,91 +2182,1763 @@ Style/ClassEqualityComparison: - 'app/helpers/jsonld_helper.rb' - 'app/serializers/activitypub/outbox_serializer.rb' -# Offense count: 7 Style/CombinableLoops: Exclude: - 'app/models/form/custom_emoji_batch.rb' - 'app/models/form/ip_block_batch.rb' -# Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). Style/ConcatArrayLiterals: Exclude: - 'app/lib/feed_manager.rb' -# Offense count: 1433 # Configuration parameters: AllowedConstants. Style/Documentation: - Enabled: false - -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedVars. -Style/FetchEnvVar: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/lib/redis_configuration.rb' - - 'app/lib/translation_service.rb' - - 'lib/mastodon/premailer_webpack_strategy.rb' - - 'lib/mastodon/redis_config.rb' - - 'lib/tasks/repo.rake' - - 'spec/features/profile_spec.rb' - -# Offense count: 15 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. -# SupportedStyles: annotated, template, unannotated -Style/FormatStringToken: - Exclude: - - 'app/models/privacy_policy.rb' - - 'lib/mastodon/maintenance_cli.rb' - - 'lib/paperclip/color_extractor.rb' - -# Offense count: 713 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Enabled: false - -# Offense count: 34 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. -Style/GuardClause: Exclude: + - 'app/chewy/accounts_index.rb' + - 'app/chewy/statuses_index.rb' + - 'app/chewy/tags_index.rb' + - 'app/controllers/about_controller.rb' + - 'app/controllers/accounts_controller.rb' + - 'app/controllers/activitypub/base_controller.rb' + - 'app/controllers/activitypub/claims_controller.rb' + - 'app/controllers/activitypub/collections_controller.rb' + - 'app/controllers/activitypub/followers_synchronizations_controller.rb' + - 'app/controllers/activitypub/inboxes_controller.rb' + - 'app/controllers/activitypub/outboxes_controller.rb' + - 'app/controllers/activitypub/replies_controller.rb' + - 'app/controllers/admin/account_actions_controller.rb' + - 'app/controllers/admin/account_moderation_notes_controller.rb' + - 'app/controllers/admin/accounts_controller.rb' + - 'app/controllers/admin/action_logs_controller.rb' + - 'app/controllers/admin/announcements_controller.rb' + - 'app/controllers/admin/base_controller.rb' + - 'app/controllers/admin/change_emails_controller.rb' - 'app/controllers/admin/confirmations_controller.rb' + - 'app/controllers/admin/custom_emojis_controller.rb' + - 'app/controllers/admin/dashboard_controller.rb' + - 'app/controllers/admin/disputes/appeals_controller.rb' + - 'app/controllers/admin/domain_allows_controller.rb' + - 'app/controllers/admin/domain_blocks_controller.rb' + - 'app/controllers/admin/email_domain_blocks_controller.rb' + - 'app/controllers/admin/export_domain_allows_controller.rb' + - 'app/controllers/admin/export_domain_blocks_controller.rb' + - 'app/controllers/admin/follow_recommendations_controller.rb' + - 'app/controllers/admin/instances_controller.rb' + - 'app/controllers/admin/invites_controller.rb' + - 'app/controllers/admin/ip_blocks_controller.rb' + - 'app/controllers/admin/relationships_controller.rb' + - 'app/controllers/admin/relays_controller.rb' + - 'app/controllers/admin/report_notes_controller.rb' + - 'app/controllers/admin/reports/actions_controller.rb' + - 'app/controllers/admin/reports_controller.rb' + - 'app/controllers/admin/resets_controller.rb' + - 'app/controllers/admin/roles_controller.rb' + - 'app/controllers/admin/rules_controller.rb' + - 'app/controllers/admin/settings/about_controller.rb' + - 'app/controllers/admin/settings/appearance_controller.rb' + - 'app/controllers/admin/settings/branding_controller.rb' + - 'app/controllers/admin/settings/content_retention_controller.rb' + - 'app/controllers/admin/settings/discovery_controller.rb' + - 'app/controllers/admin/settings/registrations_controller.rb' + - 'app/controllers/admin/settings_controller.rb' + - 'app/controllers/admin/site_uploads_controller.rb' + - 'app/controllers/admin/statuses_controller.rb' + - 'app/controllers/admin/tags_controller.rb' + - 'app/controllers/admin/trends/links/preview_card_providers_controller.rb' + - 'app/controllers/admin/trends/links_controller.rb' + - 'app/controllers/admin/trends/statuses_controller.rb' + - 'app/controllers/admin/trends/tags_controller.rb' + - 'app/controllers/admin/users/roles_controller.rb' + - 'app/controllers/admin/users/two_factor_authentications_controller.rb' + - 'app/controllers/admin/warning_presets_controller.rb' + - 'app/controllers/admin/webhooks/secrets_controller.rb' + - 'app/controllers/admin/webhooks_controller.rb' + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/api/oembed_controller.rb' + - 'app/controllers/api/v1/accounts/credentials_controller.rb' + - 'app/controllers/api/v1/accounts/familiar_followers_controller.rb' + - 'app/controllers/api/v1/accounts/featured_tags_controller.rb' + - 'app/controllers/api/v1/accounts/follower_accounts_controller.rb' + - 'app/controllers/api/v1/accounts/following_accounts_controller.rb' + - 'app/controllers/api/v1/accounts/identity_proofs_controller.rb' + - 'app/controllers/api/v1/accounts/lists_controller.rb' + - 'app/controllers/api/v1/accounts/lookup_controller.rb' + - 'app/controllers/api/v1/accounts/notes_controller.rb' + - 'app/controllers/api/v1/accounts/pins_controller.rb' + - 'app/controllers/api/v1/accounts/relationships_controller.rb' + - 'app/controllers/api/v1/accounts/search_controller.rb' + - 'app/controllers/api/v1/accounts/statuses_controller.rb' + - 'app/controllers/api/v1/accounts_controller.rb' + - 'app/controllers/api/v1/admin/account_actions_controller.rb' + - 'app/controllers/api/v1/admin/accounts_controller.rb' + - 'app/controllers/api/v1/admin/canonical_email_blocks_controller.rb' + - 'app/controllers/api/v1/admin/dimensions_controller.rb' + - 'app/controllers/api/v1/admin/domain_allows_controller.rb' + - 'app/controllers/api/v1/admin/domain_blocks_controller.rb' + - 'app/controllers/api/v1/admin/email_domain_blocks_controller.rb' + - 'app/controllers/api/v1/admin/ip_blocks_controller.rb' + - 'app/controllers/api/v1/admin/measures_controller.rb' + - 'app/controllers/api/v1/admin/reports_controller.rb' + - 'app/controllers/api/v1/admin/retention_controller.rb' + - 'app/controllers/api/v1/admin/trends/links_controller.rb' + - 'app/controllers/api/v1/admin/trends/statuses_controller.rb' + - 'app/controllers/api/v1/admin/trends/tags_controller.rb' + - 'app/controllers/api/v1/announcements/reactions_controller.rb' + - 'app/controllers/api/v1/announcements_controller.rb' + - 'app/controllers/api/v1/apps/credentials_controller.rb' + - 'app/controllers/api/v1/apps_controller.rb' + - 'app/controllers/api/v1/blocks_controller.rb' + - 'app/controllers/api/v1/bookmarks_controller.rb' + - 'app/controllers/api/v1/conversations_controller.rb' + - 'app/controllers/api/v1/crypto/deliveries_controller.rb' + - 'app/controllers/api/v1/crypto/encrypted_messages_controller.rb' + - 'app/controllers/api/v1/crypto/keys/claims_controller.rb' + - 'app/controllers/api/v1/crypto/keys/counts_controller.rb' + - 'app/controllers/api/v1/crypto/keys/queries_controller.rb' + - 'app/controllers/api/v1/crypto/keys/uploads_controller.rb' + - 'app/controllers/api/v1/custom_emojis_controller.rb' + - 'app/controllers/api/v1/directories_controller.rb' + - 'app/controllers/api/v1/domain_blocks_controller.rb' + - 'app/controllers/api/v1/emails/confirmations_controller.rb' + - 'app/controllers/api/v1/endorsements_controller.rb' + - 'app/controllers/api/v1/favourites_controller.rb' + - 'app/controllers/api/v1/featured_tags/suggestions_controller.rb' + - 'app/controllers/api/v1/featured_tags_controller.rb' + - 'app/controllers/api/v1/filters_controller.rb' + - 'app/controllers/api/v1/follow_requests_controller.rb' + - 'app/controllers/api/v1/followed_tags_controller.rb' + - 'app/controllers/api/v1/instances/activity_controller.rb' + - 'app/controllers/api/v1/instances/domain_blocks_controller.rb' + - 'app/controllers/api/v1/instances/extended_descriptions_controller.rb' + - 'app/controllers/api/v1/instances/peers_controller.rb' + - 'app/controllers/api/v1/instances/privacy_policies_controller.rb' + - 'app/controllers/api/v1/instances/rules_controller.rb' + - 'app/controllers/api/v1/instances_controller.rb' + - 'app/controllers/api/v1/lists/accounts_controller.rb' + - 'app/controllers/api/v1/lists_controller.rb' + - 'app/controllers/api/v1/markers_controller.rb' + - 'app/controllers/api/v1/media_controller.rb' + - 'app/controllers/api/v1/mutes_controller.rb' + - 'app/controllers/api/v1/notifications_controller.rb' + - 'app/controllers/api/v1/polls/votes_controller.rb' + - 'app/controllers/api/v1/polls_controller.rb' + - 'app/controllers/api/v1/preferences_controller.rb' + - 'app/controllers/api/v1/push/subscriptions_controller.rb' + - 'app/controllers/api/v1/reports_controller.rb' + - 'app/controllers/api/v1/scheduled_statuses_controller.rb' + - 'app/controllers/api/v1/statuses/bookmarks_controller.rb' + - 'app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb' + - 'app/controllers/api/v1/statuses/favourites_controller.rb' + - 'app/controllers/api/v1/statuses/histories_controller.rb' + - 'app/controllers/api/v1/statuses/mutes_controller.rb' + - 'app/controllers/api/v1/statuses/pins_controller.rb' + - 'app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb' + - 'app/controllers/api/v1/statuses/reblogs_controller.rb' + - 'app/controllers/api/v1/statuses/sources_controller.rb' + - 'app/controllers/api/v1/statuses/translations_controller.rb' + - 'app/controllers/api/v1/statuses_controller.rb' + - 'app/controllers/api/v1/streaming_controller.rb' + - 'app/controllers/api/v1/suggestions_controller.rb' + - 'app/controllers/api/v1/tags_controller.rb' + - 'app/controllers/api/v1/timelines/home_controller.rb' + - 'app/controllers/api/v1/timelines/list_controller.rb' + - 'app/controllers/api/v1/timelines/public_controller.rb' + - 'app/controllers/api/v1/timelines/tag_controller.rb' + - 'app/controllers/api/v1/trends/links_controller.rb' + - 'app/controllers/api/v1/trends/statuses_controller.rb' + - 'app/controllers/api/v1/trends/tags_controller.rb' + - 'app/controllers/api/v2/admin/accounts_controller.rb' + - 'app/controllers/api/v2/filters/keywords_controller.rb' + - 'app/controllers/api/v2/filters/statuses_controller.rb' + - 'app/controllers/api/v2/filters_controller.rb' + - 'app/controllers/api/v2/instances_controller.rb' + - 'app/controllers/api/v2/media_controller.rb' + - 'app/controllers/api/v2/search_controller.rb' + - 'app/controllers/api/v2/suggestions_controller.rb' + - 'app/controllers/api/web/base_controller.rb' + - 'app/controllers/api/web/embeds_controller.rb' + - 'app/controllers/api/web/push_subscriptions_controller.rb' + - 'app/controllers/api/web/settings_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/auth/challenges_controller.rb' - 'app/controllers/auth/confirmations_controller.rb' + - 'app/controllers/auth/omniauth_callbacks_controller.rb' - 'app/controllers/auth/passwords_controller.rb' + - 'app/controllers/auth/registrations_controller.rb' + - 'app/controllers/auth/sessions_controller.rb' + - 'app/controllers/auth/setup_controller.rb' + - 'app/controllers/authorize_interactions_controller.rb' + - 'app/controllers/concerns/access_token_tracking_concern.rb' + - 'app/controllers/concerns/account_controller_concern.rb' + - 'app/controllers/concerns/account_owned_concern.rb' + - 'app/controllers/concerns/accountable_concern.rb' + - 'app/controllers/concerns/admin_export_controller_concern.rb' + - 'app/controllers/concerns/authorization.rb' + - 'app/controllers/concerns/cache_concern.rb' + - 'app/controllers/concerns/export_controller_concern.rb' + - 'app/controllers/concerns/localized.rb' + - 'app/controllers/concerns/rate_limit_headers.rb' + - 'app/controllers/concerns/registration_spam_concern.rb' + - 'app/controllers/concerns/session_tracking_concern.rb' + - 'app/controllers/concerns/signature_authentication.rb' + - 'app/controllers/concerns/signature_verification.rb' + - 'app/controllers/concerns/two_factor_authentication_concern.rb' + - 'app/controllers/concerns/user_tracking_concern.rb' + - 'app/controllers/concerns/web_app_controller_concern.rb' + - 'app/controllers/custom_css_controller.rb' + - 'app/controllers/disputes/appeals_controller.rb' + - 'app/controllers/disputes/base_controller.rb' + - 'app/controllers/disputes/strikes_controller.rb' + - 'app/controllers/emojis_controller.rb' + - 'app/controllers/filters/statuses_controller.rb' + - 'app/controllers/filters_controller.rb' + - 'app/controllers/follower_accounts_controller.rb' + - 'app/controllers/following_accounts_controller.rb' + - 'app/controllers/health_controller.rb' + - 'app/controllers/home_controller.rb' + - 'app/controllers/instance_actors_controller.rb' + - 'app/controllers/intents_controller.rb' + - 'app/controllers/invites_controller.rb' + - 'app/controllers/manifests_controller.rb' + - 'app/controllers/media_controller.rb' + - 'app/controllers/media_proxy_controller.rb' + - 'app/controllers/oauth/authorizations_controller.rb' + - 'app/controllers/oauth/authorized_applications_controller.rb' + - 'app/controllers/oauth/tokens_controller.rb' + - 'app/controllers/privacy_controller.rb' + - 'app/controllers/relationships_controller.rb' + - 'app/controllers/settings/aliases_controller.rb' + - 'app/controllers/settings/applications_controller.rb' + - 'app/controllers/settings/base_controller.rb' + - 'app/controllers/settings/deletes_controller.rb' + - 'app/controllers/settings/exports/blocked_accounts_controller.rb' + - 'app/controllers/settings/exports/blocked_domains_controller.rb' + - 'app/controllers/settings/exports/bookmarks_controller.rb' + - 'app/controllers/settings/exports/following_accounts_controller.rb' + - 'app/controllers/settings/exports/lists_controller.rb' + - 'app/controllers/settings/exports/muted_accounts_controller.rb' + - 'app/controllers/settings/exports_controller.rb' + - 'app/controllers/settings/featured_tags_controller.rb' + - 'app/controllers/settings/imports_controller.rb' + - 'app/controllers/settings/login_activities_controller.rb' + - 'app/controllers/settings/migration/redirects_controller.rb' + - 'app/controllers/settings/migrations_controller.rb' + - 'app/controllers/settings/pictures_controller.rb' + - 'app/controllers/settings/preferences/appearance_controller.rb' + - 'app/controllers/settings/preferences/notifications_controller.rb' + - 'app/controllers/settings/preferences/other_controller.rb' + - 'app/controllers/settings/preferences_controller.rb' + - 'app/controllers/settings/profiles_controller.rb' + - 'app/controllers/settings/sessions_controller.rb' + - 'app/controllers/settings/two_factor_authentication/confirmations_controller.rb' + - 'app/controllers/settings/two_factor_authentication/otp_authentication_controller.rb' + - 'app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb' - 'app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb' + - 'app/controllers/settings/two_factor_authentication_methods_controller.rb' + - 'app/controllers/shares_controller.rb' + - 'app/controllers/statuses_cleanup_controller.rb' + - 'app/controllers/statuses_controller.rb' + - 'app/controllers/tags_controller.rb' + - 'app/controllers/well_known/host_meta_controller.rb' + - 'app/controllers/well_known/nodeinfo_controller.rb' + - 'app/controllers/well_known/webfinger_controller.rb' + - 'app/helpers/accounts_helper.rb' + - 'app/helpers/admin/account_moderation_notes_helper.rb' + - 'app/helpers/admin/action_logs_helper.rb' + - 'app/helpers/admin/dashboard_helper.rb' + - 'app/helpers/admin/filter_helper.rb' + - 'app/helpers/admin/settings_helper.rb' + - 'app/helpers/admin/trends/statuses_helper.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/branding_helper.rb' + - 'app/helpers/context_helper.rb' + - 'app/helpers/domain_control_helper.rb' + - 'app/helpers/email_helper.rb' + - 'app/helpers/flashes_helper.rb' + - 'app/helpers/formatting_helper.rb' + - 'app/helpers/home_helper.rb' + - 'app/helpers/instance_helper.rb' + - 'app/helpers/jsonld_helper.rb' + - 'app/helpers/languages_helper.rb' + - 'app/helpers/mascot_helper.rb' + - 'app/helpers/routing_helper.rb' + - 'app/helpers/settings_helper.rb' + - 'app/helpers/statuses_helper.rb' + - 'app/helpers/webfinger_helper.rb' + - 'app/lib/access_token_extension.rb' + - 'app/lib/account_reach_finder.rb' + - 'app/lib/activity_tracker.rb' + - 'app/lib/activitypub/activity.rb' + - 'app/lib/activitypub/activity/accept.rb' + - 'app/lib/activitypub/activity/add.rb' + - 'app/lib/activitypub/activity/announce.rb' - 'app/lib/activitypub/activity/block.rb' + - 'app/lib/activitypub/activity/create.rb' + - 'app/lib/activitypub/activity/delete.rb' + - 'app/lib/activitypub/activity/flag.rb' + - 'app/lib/activitypub/activity/follow.rb' + - 'app/lib/activitypub/activity/like.rb' + - 'app/lib/activitypub/activity/move.rb' + - 'app/lib/activitypub/activity/reject.rb' + - 'app/lib/activitypub/activity/remove.rb' + - 'app/lib/activitypub/activity/undo.rb' + - 'app/lib/activitypub/activity/update.rb' + - 'app/lib/activitypub/adapter.rb' + - 'app/lib/activitypub/case_transform.rb' + - 'app/lib/activitypub/dereferencer.rb' + - 'app/lib/activitypub/forwarder.rb' + - 'app/lib/activitypub/linked_data_signature.rb' + - 'app/lib/activitypub/parser/custom_emoji_parser.rb' + - 'app/lib/activitypub/parser/media_attachment_parser.rb' + - 'app/lib/activitypub/parser/poll_parser.rb' + - 'app/lib/activitypub/parser/status_parser.rb' + - 'app/lib/activitypub/serializer.rb' + - 'app/lib/activitypub/tag_manager.rb' + - 'app/lib/admin/metrics/dimension.rb' + - 'app/lib/admin/metrics/dimension/base_dimension.rb' + - 'app/lib/admin/metrics/dimension/instance_accounts_dimension.rb' + - 'app/lib/admin/metrics/dimension/instance_languages_dimension.rb' + - 'app/lib/admin/metrics/dimension/languages_dimension.rb' + - 'app/lib/admin/metrics/dimension/servers_dimension.rb' + - 'app/lib/admin/metrics/dimension/software_versions_dimension.rb' + - 'app/lib/admin/metrics/dimension/sources_dimension.rb' + - 'app/lib/admin/metrics/dimension/space_usage_dimension.rb' + - 'app/lib/admin/metrics/dimension/tag_languages_dimension.rb' + - 'app/lib/admin/metrics/dimension/tag_servers_dimension.rb' + - 'app/lib/admin/metrics/measure.rb' + - 'app/lib/admin/metrics/measure/active_users_measure.rb' + - 'app/lib/admin/metrics/measure/base_measure.rb' + - 'app/lib/admin/metrics/measure/instance_accounts_measure.rb' + - 'app/lib/admin/metrics/measure/instance_followers_measure.rb' + - 'app/lib/admin/metrics/measure/instance_follows_measure.rb' + - 'app/lib/admin/metrics/measure/instance_media_attachments_measure.rb' + - 'app/lib/admin/metrics/measure/instance_reports_measure.rb' + - 'app/lib/admin/metrics/measure/instance_statuses_measure.rb' + - 'app/lib/admin/metrics/measure/interactions_measure.rb' + - 'app/lib/admin/metrics/measure/new_users_measure.rb' + - 'app/lib/admin/metrics/measure/opened_reports_measure.rb' + - 'app/lib/admin/metrics/measure/resolved_reports_measure.rb' + - 'app/lib/admin/metrics/measure/tag_accounts_measure.rb' + - 'app/lib/admin/metrics/measure/tag_servers_measure.rb' + - 'app/lib/admin/metrics/measure/tag_uses_measure.rb' + - 'app/lib/admin/metrics/retention.rb' + - 'app/lib/admin/system_check.rb' + - 'app/lib/admin/system_check/base_check.rb' + - 'app/lib/admin/system_check/database_schema_check.rb' + - 'app/lib/admin/system_check/elasticsearch_check.rb' + - 'app/lib/admin/system_check/message.rb' + - 'app/lib/admin/system_check/rules_check.rb' + - 'app/lib/admin/system_check/sidekiq_process_check.rb' + - 'app/lib/application_extension.rb' + - 'app/lib/ascii_folding.rb' + - 'app/lib/cache_buster.rb' - 'app/lib/connection_pool/shared_connection_pool.rb' + - 'app/lib/connection_pool/shared_timed_stack.rb' + - 'app/lib/delivery_failure_tracker.rb' + - 'app/lib/emoji_formatter.rb' + - 'app/lib/entity_cache.rb' + - 'app/lib/extractor.rb' + - 'app/lib/fast_geometry_parser.rb' + - 'app/lib/fast_ip_map.rb' + - 'app/lib/feed_manager.rb' + - 'app/lib/hash_object.rb' + - 'app/lib/hashtag_normalizer.rb' + - 'app/lib/html_aware_formatter.rb' + - 'app/lib/importer/accounts_index_importer.rb' + - 'app/lib/importer/base_importer.rb' + - 'app/lib/importer/statuses_index_importer.rb' + - 'app/lib/importer/tags_index_importer.rb' + - 'app/lib/inline_renderer.rb' + - 'app/lib/link_details_extractor.rb' + - 'app/lib/nodeinfo/adapter.rb' + - 'app/lib/ostatus/tag_manager.rb' + - 'app/lib/permalink_redirector.rb' + - 'app/lib/plain_text_formatter.rb' + - 'app/lib/potential_friendship_tracker.rb' + - 'app/lib/rate_limiter.rb' + - 'app/lib/redis_configuration.rb' - 'app/lib/request.rb' - 'app/lib/request_pool.rb' + - 'app/lib/response_with_limit.rb' + - 'app/lib/rss/builder.rb' + - 'app/lib/rss/channel.rb' + - 'app/lib/rss/element.rb' + - 'app/lib/rss/item.rb' + - 'app/lib/rss/media_content.rb' + - 'app/lib/scope_parser.rb' + - 'app/lib/scope_transformer.rb' + - 'app/lib/search_query_parser.rb' + - 'app/lib/search_query_transformer.rb' + - 'app/lib/settings/extend.rb' + - 'app/lib/settings/scoped_settings.rb' + - 'app/lib/status_cache_hydrator.rb' + - 'app/lib/status_filter.rb' + - 'app/lib/status_finder.rb' + - 'app/lib/status_reach_finder.rb' + - 'app/lib/suspicious_sign_in_detector.rb' + - 'app/lib/tag_manager.rb' + - 'app/lib/text_formatter.rb' + - 'app/lib/themes.rb' + - 'app/lib/translation_service.rb' + - 'app/lib/translation_service/deepl.rb' + - 'app/lib/translation_service/libre_translate.rb' + - 'app/lib/translation_service/translation.rb' + - 'app/lib/user_settings_decorator.rb' + - 'app/lib/vacuum.rb' + - 'app/lib/vacuum/access_tokens_vacuum.rb' + - 'app/lib/vacuum/backups_vacuum.rb' + - 'app/lib/vacuum/feeds_vacuum.rb' + - 'app/lib/vacuum/media_attachments_vacuum.rb' + - 'app/lib/vacuum/preview_cards_vacuum.rb' + - 'app/lib/vacuum/statuses_vacuum.rb' + - 'app/lib/vacuum/system_keys_vacuum.rb' + - 'app/lib/validation_error_formatter.rb' + - 'app/lib/video_metadata_extractor.rb' - 'app/lib/webfinger.rb' - 'app/lib/webfinger_resource.rb' + - 'app/mailers/admin_mailer.rb' + - 'app/mailers/application_mailer.rb' + - 'app/mailers/notification_mailer.rb' + - 'app/mailers/user_mailer.rb' + - 'app/models/account.rb' + - 'app/models/account/field.rb' + - 'app/models/account_alias.rb' + - 'app/models/account_conversation.rb' + - 'app/models/account_domain_block.rb' + - 'app/models/account_filter.rb' + - 'app/models/account_migration.rb' + - 'app/models/account_moderation_note.rb' + - 'app/models/account_pin.rb' + - 'app/models/account_stat.rb' + - 'app/models/account_statuses_filter.rb' + - 'app/models/account_suggestions.rb' + - 'app/models/account_suggestions/global_source.rb' + - 'app/models/account_suggestions/past_interactions_source.rb' + - 'app/models/account_suggestions/setting_source.rb' + - 'app/models/account_suggestions/source.rb' + - 'app/models/account_suggestions/suggestion.rb' + - 'app/models/account_summary.rb' + - 'app/models/account_warning.rb' + - 'app/models/account_warning_preset.rb' + - 'app/models/admin.rb' + - 'app/models/admin/account_action.rb' + - 'app/models/admin/action_log.rb' + - 'app/models/admin/action_log_filter.rb' + - 'app/models/admin/appeal_filter.rb' + - 'app/models/admin/status_batch_action.rb' + - 'app/models/admin/status_filter.rb' + - 'app/models/announcement.rb' + - 'app/models/announcement_filter.rb' + - 'app/models/announcement_mute.rb' + - 'app/models/announcement_reaction.rb' + - 'app/models/application_record.rb' + - 'app/models/backup.rb' + - 'app/models/block.rb' + - 'app/models/bookmark.rb' + - 'app/models/canonical_email_block.rb' + - 'app/models/concerns/account_associations.rb' + - 'app/models/concerns/account_avatar.rb' - 'app/models/concerns/account_counters.rb' + - 'app/models/concerns/account_finder_concern.rb' + - 'app/models/concerns/account_header.rb' + - 'app/models/concerns/account_interactions.rb' + - 'app/models/concerns/account_merging.rb' + - 'app/models/concerns/attachmentable.rb' + - 'app/models/concerns/cacheable.rb' + - 'app/models/concerns/domain_materializable.rb' + - 'app/models/concerns/domain_normalizable.rb' + - 'app/models/concerns/expireable.rb' + - 'app/models/concerns/follow_limitable.rb' - 'app/models/concerns/ldap_authenticable.rb' - - 'app/models/tag.rb' - - 'app/models/user.rb' - - 'app/services/fan_out_on_write_service.rb' - - 'app/services/post_status_service.rb' - - 'app/services/process_hashtags_service.rb' - - 'app/workers/move_worker.rb' - - 'app/workers/redownload_avatar_worker.rb' - - 'app/workers/redownload_header_worker.rb' - - 'app/workers/redownload_media_worker.rb' - - 'app/workers/remote_account_refresh_worker.rb' - - 'db/migrate/20170901141119_truncate_preview_cards.rb' - - 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb' - - 'lib/devise/two_factor_ldap_authenticatable.rb' - - 'lib/devise/two_factor_pam_authenticatable.rb' - - 'lib/mastodon/accounts_cli.rb' - - 'lib/mastodon/maintenance_cli.rb' - - 'lib/mastodon/media_cli.rb' - - 'lib/paperclip/attachment_extensions.rb' - - 'lib/tasks/repo.rake' - -# Offense count: 13 + - 'app/models/concerns/lockable.rb' + - 'app/models/concerns/omniauthable.rb' + - 'app/models/concerns/paginable.rb' + - 'app/models/concerns/pam_authenticable.rb' + - 'app/models/concerns/rate_limitable.rb' + - 'app/models/concerns/redisable.rb' + - 'app/models/concerns/relationship_cacheable.rb' + - 'app/models/concerns/remotable.rb' + - 'app/models/concerns/status_snapshot_concern.rb' + - 'app/models/concerns/status_threading_concern.rb' + - 'app/models/content_retention_policy.rb' + - 'app/models/context.rb' + - 'app/models/conversation.rb' + - 'app/models/conversation_mute.rb' + - 'app/models/custom_emoji.rb' + - 'app/models/custom_emoji_category.rb' + - 'app/models/custom_emoji_filter.rb' + - 'app/models/custom_filter.rb' + - 'app/models/custom_filter_keyword.rb' + - 'app/models/custom_filter_status.rb' + - 'app/models/device.rb' + - 'app/models/domain_allow.rb' + - 'app/models/domain_block.rb' + - 'app/models/email_domain_block.rb' + - 'app/models/encrypted_message.rb' + - 'app/models/export.rb' + - 'app/models/extended_description.rb' + - 'app/models/favourite.rb' + - 'app/models/featured_tag.rb' + - 'app/models/feed.rb' + - 'app/models/follow.rb' + - 'app/models/follow_recommendation.rb' + - 'app/models/follow_recommendation_filter.rb' + - 'app/models/follow_recommendation_suppression.rb' + - 'app/models/follow_request.rb' + - 'app/models/form/account_batch.rb' + - 'app/models/form/admin_settings.rb' + - 'app/models/form/challenge.rb' + - 'app/models/form/custom_emoji_batch.rb' + - 'app/models/form/delete_confirmation.rb' + - 'app/models/form/domain_block_batch.rb' + - 'app/models/form/email_domain_block_batch.rb' + - 'app/models/form/ip_block_batch.rb' + - 'app/models/form/redirect.rb' + - 'app/models/form/status_filter_batch_action.rb' + - 'app/models/form/two_factor_confirmation.rb' + - 'app/models/home_feed.rb' + - 'app/models/identity.rb' + - 'app/models/import.rb' + - 'app/models/instance.rb' + - 'app/models/instance_filter.rb' + - 'app/models/invite.rb' + - 'app/models/invite_filter.rb' + - 'app/models/ip_block.rb' + - 'app/models/list.rb' + - 'app/models/list_account.rb' + - 'app/models/list_feed.rb' + - 'app/models/login_activity.rb' + - 'app/models/marker.rb' + - 'app/models/media_attachment.rb' + - 'app/models/mention.rb' + - 'app/models/message_franking.rb' + - 'app/models/mute.rb' + - 'app/models/notification.rb' + - 'app/models/one_time_key.rb' + - 'app/models/poll.rb' + - 'app/models/poll_vote.rb' + - 'app/models/preview_card.rb' + - 'app/models/preview_card_provider.rb' + - 'app/models/privacy_policy.rb' + - 'app/models/public_feed.rb' + - 'app/models/relationship_filter.rb' + - 'app/models/relay.rb' + - 'app/models/remote_follow.rb' + - 'app/models/report.rb' + - 'app/models/report_filter.rb' + - 'app/models/report_note.rb' + - 'app/models/scheduled_status.rb' + - 'app/models/search.rb' + - 'app/models/session_activation.rb' + - 'app/models/setting.rb' + - 'app/models/site_upload.rb' + - 'app/models/status.rb' + - 'app/models/status_edit.rb' + - 'app/models/status_pin.rb' + - 'app/models/status_stat.rb' + - 'app/models/status_trend.rb' + - 'app/models/tag.rb' + - 'app/models/tag_feed.rb' + - 'app/models/tag_follow.rb' + - 'app/models/tombstone.rb' + - 'app/models/trends.rb' + - 'app/models/trends/base.rb' + - 'app/models/trends/history.rb' + - 'app/models/trends/links.rb' + - 'app/models/trends/preview_card_batch.rb' + - 'app/models/trends/preview_card_filter.rb' + - 'app/models/trends/preview_card_provider_batch.rb' + - 'app/models/trends/preview_card_provider_filter.rb' + - 'app/models/trends/query.rb' + - 'app/models/trends/status_batch.rb' + - 'app/models/trends/status_filter.rb' + - 'app/models/trends/statuses.rb' + - 'app/models/trends/tag_batch.rb' + - 'app/models/trends/tag_filter.rb' + - 'app/models/trends/tags.rb' + - 'app/models/unavailable_domain.rb' + - 'app/models/user.rb' + - 'app/models/user_invite_request.rb' + - 'app/models/user_ip.rb' + - 'app/models/user_role.rb' + - 'app/models/web.rb' + - 'app/models/web/push_subscription.rb' + - 'app/models/web/setting.rb' + - 'app/models/webauthn_credential.rb' + - 'app/models/webhook.rb' + - 'app/policies/account_moderation_note_policy.rb' + - 'app/policies/account_policy.rb' + - 'app/policies/account_warning_policy.rb' + - 'app/policies/account_warning_preset_policy.rb' + - 'app/policies/admin/status_policy.rb' + - 'app/policies/announcement_policy.rb' + - 'app/policies/appeal_policy.rb' + - 'app/policies/application_policy.rb' + - 'app/policies/audit_log_policy.rb' + - 'app/policies/backup_policy.rb' + - 'app/policies/canonical_email_block_policy.rb' + - 'app/policies/custom_emoji_policy.rb' + - 'app/policies/dashboard_policy.rb' + - 'app/policies/delivery_policy.rb' + - 'app/policies/domain_allow_policy.rb' + - 'app/policies/domain_block_policy.rb' + - 'app/policies/email_domain_block_policy.rb' + - 'app/policies/follow_recommendation_policy.rb' + - 'app/policies/instance_policy.rb' + - 'app/policies/invite_policy.rb' + - 'app/policies/ip_block_policy.rb' + - 'app/policies/poll_policy.rb' + - 'app/policies/preview_card_policy.rb' + - 'app/policies/preview_card_provider_policy.rb' + - 'app/policies/relay_policy.rb' + - 'app/policies/report_note_policy.rb' + - 'app/policies/report_policy.rb' + - 'app/policies/rule_policy.rb' + - 'app/policies/settings_policy.rb' + - 'app/policies/status_policy.rb' + - 'app/policies/tag_policy.rb' + - 'app/policies/user_policy.rb' + - 'app/policies/user_role_policy.rb' + - 'app/policies/webhook_policy.rb' + - 'app/presenters/account_relationships_presenter.rb' + - 'app/presenters/activitypub/activity_presenter.rb' + - 'app/presenters/activitypub/collection_presenter.rb' + - 'app/presenters/familiar_followers_presenter.rb' + - 'app/presenters/filter_result_presenter.rb' + - 'app/presenters/initial_state_presenter.rb' + - 'app/presenters/instance_presenter.rb' + - 'app/presenters/status_relationships_presenter.rb' + - 'app/presenters/tag_relationships_presenter.rb' + - 'app/presenters/webhooks/event_presenter.rb' + - 'app/serializers/activitypub/accept_follow_serializer.rb' + - 'app/serializers/activitypub/activity_serializer.rb' + - 'app/serializers/activitypub/actor_serializer.rb' + - 'app/serializers/activitypub/add_serializer.rb' + - 'app/serializers/activitypub/block_serializer.rb' + - 'app/serializers/activitypub/collection_serializer.rb' + - 'app/serializers/activitypub/delete_actor_serializer.rb' + - 'app/serializers/activitypub/delete_serializer.rb' + - 'app/serializers/activitypub/device_serializer.rb' + - 'app/serializers/activitypub/emoji_serializer.rb' + - 'app/serializers/activitypub/encrypted_message_serializer.rb' + - 'app/serializers/activitypub/flag_serializer.rb' + - 'app/serializers/activitypub/follow_serializer.rb' + - 'app/serializers/activitypub/hashtag_serializer.rb' + - 'app/serializers/activitypub/image_serializer.rb' + - 'app/serializers/activitypub/like_serializer.rb' + - 'app/serializers/activitypub/move_serializer.rb' + - 'app/serializers/activitypub/note_serializer.rb' + - 'app/serializers/activitypub/one_time_key_serializer.rb' + - 'app/serializers/activitypub/outbox_serializer.rb' + - 'app/serializers/activitypub/public_key_serializer.rb' + - 'app/serializers/activitypub/reject_follow_serializer.rb' + - 'app/serializers/activitypub/remove_serializer.rb' + - 'app/serializers/activitypub/undo_announce_serializer.rb' + - 'app/serializers/activitypub/undo_block_serializer.rb' + - 'app/serializers/activitypub/undo_follow_serializer.rb' + - 'app/serializers/activitypub/undo_like_serializer.rb' + - 'app/serializers/activitypub/update_poll_serializer.rb' + - 'app/serializers/activitypub/update_serializer.rb' + - 'app/serializers/activitypub/vote_serializer.rb' + - 'app/serializers/initial_state_serializer.rb' + - 'app/serializers/manifest_serializer.rb' + - 'app/serializers/nodeinfo/discovery_serializer.rb' + - 'app/serializers/nodeinfo/serializer.rb' + - 'app/serializers/oembed_serializer.rb' + - 'app/serializers/rest/account_serializer.rb' + - 'app/serializers/rest/admin/account_serializer.rb' + - 'app/serializers/rest/admin/canonical_email_block_serializer.rb' + - 'app/serializers/rest/admin/cohort_serializer.rb' + - 'app/serializers/rest/admin/dimension_serializer.rb' + - 'app/serializers/rest/admin/domain_allow_serializer.rb' + - 'app/serializers/rest/admin/domain_block_serializer.rb' + - 'app/serializers/rest/admin/email_domain_block_serializer.rb' + - 'app/serializers/rest/admin/existing_domain_block_error_serializer.rb' + - 'app/serializers/rest/admin/ip_block_serializer.rb' + - 'app/serializers/rest/admin/ip_serializer.rb' + - 'app/serializers/rest/admin/measure_serializer.rb' + - 'app/serializers/rest/admin/report_serializer.rb' + - 'app/serializers/rest/admin/tag_serializer.rb' + - 'app/serializers/rest/admin/webhook_event_serializer.rb' + - 'app/serializers/rest/announcement_serializer.rb' + - 'app/serializers/rest/application_serializer.rb' + - 'app/serializers/rest/context_serializer.rb' + - 'app/serializers/rest/conversation_serializer.rb' + - 'app/serializers/rest/credential_account_serializer.rb' + - 'app/serializers/rest/custom_emoji_serializer.rb' + - 'app/serializers/rest/domain_block_serializer.rb' + - 'app/serializers/rest/encrypted_message_serializer.rb' + - 'app/serializers/rest/extended_description_serializer.rb' + - 'app/serializers/rest/familiar_followers_serializer.rb' + - 'app/serializers/rest/featured_tag_serializer.rb' + - 'app/serializers/rest/filter_keyword_serializer.rb' + - 'app/serializers/rest/filter_result_serializer.rb' + - 'app/serializers/rest/filter_serializer.rb' + - 'app/serializers/rest/filter_status_serializer.rb' + - 'app/serializers/rest/instance_serializer.rb' + - 'app/serializers/rest/keys/claim_result_serializer.rb' + - 'app/serializers/rest/keys/device_serializer.rb' + - 'app/serializers/rest/keys/query_result_serializer.rb' + - 'app/serializers/rest/list_serializer.rb' + - 'app/serializers/rest/marker_serializer.rb' + - 'app/serializers/rest/media_attachment_serializer.rb' + - 'app/serializers/rest/muted_account_serializer.rb' + - 'app/serializers/rest/notification_serializer.rb' + - 'app/serializers/rest/poll_serializer.rb' + - 'app/serializers/rest/preferences_serializer.rb' + - 'app/serializers/rest/preview_card_serializer.rb' + - 'app/serializers/rest/privacy_policy_serializer.rb' + - 'app/serializers/rest/reaction_serializer.rb' + - 'app/serializers/rest/relationship_serializer.rb' + - 'app/serializers/rest/report_serializer.rb' + - 'app/serializers/rest/role_serializer.rb' + - 'app/serializers/rest/rule_serializer.rb' + - 'app/serializers/rest/scheduled_status_serializer.rb' + - 'app/serializers/rest/search_serializer.rb' + - 'app/serializers/rest/status_edit_serializer.rb' + - 'app/serializers/rest/status_serializer.rb' + - 'app/serializers/rest/status_source_serializer.rb' + - 'app/serializers/rest/suggestion_serializer.rb' + - 'app/serializers/rest/tag_serializer.rb' + - 'app/serializers/rest/translation_serializer.rb' + - 'app/serializers/rest/trends/link_serializer.rb' + - 'app/serializers/rest/v1/filter_serializer.rb' + - 'app/serializers/rest/v1/instance_serializer.rb' + - 'app/serializers/rest/web_push_subscription_serializer.rb' + - 'app/serializers/web/notification_serializer.rb' + - 'app/serializers/webfinger_serializer.rb' + - 'app/services/account_search_service.rb' + - 'app/services/account_statuses_cleanup_service.rb' + - 'app/services/activitypub/fetch_featured_collection_service.rb' + - 'app/services/activitypub/fetch_featured_tags_collection_service.rb' + - 'app/services/activitypub/fetch_remote_account_service.rb' + - 'app/services/activitypub/fetch_remote_actor_service.rb' + - 'app/services/activitypub/fetch_remote_key_service.rb' + - 'app/services/activitypub/fetch_remote_poll_service.rb' + - 'app/services/activitypub/fetch_remote_status_service.rb' + - 'app/services/activitypub/fetch_replies_service.rb' + - 'app/services/activitypub/prepare_followers_synchronization_service.rb' + - 'app/services/activitypub/process_account_service.rb' + - 'app/services/activitypub/process_collection_service.rb' + - 'app/services/activitypub/process_status_update_service.rb' + - 'app/services/activitypub/synchronize_followers_service.rb' + - 'app/services/after_block_domain_from_account_service.rb' + - 'app/services/after_block_service.rb' + - 'app/services/after_unallow_domain_service.rb' + - 'app/services/app_sign_up_service.rb' + - 'app/services/appeal_service.rb' + - 'app/services/approve_appeal_service.rb' + - 'app/services/authorize_follow_service.rb' + - 'app/services/backup_service.rb' + - 'app/services/base_service.rb' + - 'app/services/batched_remove_status_service.rb' + - 'app/services/block_domain_service.rb' + - 'app/services/block_service.rb' + - 'app/services/bootstrap_timeline_service.rb' + - 'app/services/clear_domain_media_service.rb' + - 'app/services/concerns/payloadable.rb' + - 'app/services/create_featured_tag_service.rb' + - 'app/services/delete_account_service.rb' + - 'app/services/deliver_to_device_service.rb' + - 'app/services/fan_out_on_write_service.rb' + - 'app/services/favourite_service.rb' + - 'app/services/fetch_link_card_service.rb' + - 'app/services/fetch_oembed_service.rb' + - 'app/services/fetch_remote_status_service.rb' + - 'app/services/fetch_resource_service.rb' + - 'app/services/follow_migration_service.rb' + - 'app/services/follow_service.rb' + - 'app/services/import_service.rb' + - 'app/services/keys/claim_service.rb' + - 'app/services/keys/query_service.rb' + - 'app/services/move_service.rb' + - 'app/services/mute_service.rb' + - 'app/services/notify_service.rb' + - 'app/services/post_status_service.rb' + - 'app/services/precompute_feed_service.rb' + - 'app/services/process_hashtags_service.rb' + - 'app/services/process_mentions_service.rb' + - 'app/services/purge_domain_service.rb' + - 'app/services/reblog_service.rb' + - 'app/services/reject_follow_service.rb' + - 'app/services/remove_domains_from_followers_service.rb' + - 'app/services/remove_featured_tag_service.rb' + - 'app/services/remove_from_followers_service.rb' + - 'app/services/remove_status_service.rb' + - 'app/services/report_service.rb' + - 'app/services/resolve_account_service.rb' + - 'app/services/resolve_url_service.rb' + - 'app/services/search_service.rb' + - 'app/services/suspend_account_service.rb' + - 'app/services/tag_search_service.rb' + - 'app/services/translate_status_service.rb' + - 'app/services/unallow_domain_service.rb' + - 'app/services/unblock_domain_service.rb' + - 'app/services/unblock_service.rb' + - 'app/services/unfavourite_service.rb' + - 'app/services/unfollow_service.rb' + - 'app/services/unmute_service.rb' + - 'app/services/unsuspend_account_service.rb' + - 'app/services/update_account_service.rb' + - 'app/services/update_status_service.rb' + - 'app/services/verify_link_service.rb' + - 'app/services/vote_service.rb' + - 'app/services/webhook_service.rb' + - 'app/validators/blacklisted_email_validator.rb' + - 'app/validators/disallowed_hashtags_validator.rb' + - 'app/validators/domain_validator.rb' + - 'app/validators/ed25519_key_validator.rb' + - 'app/validators/ed25519_signature_validator.rb' + - 'app/validators/email_mx_validator.rb' + - 'app/validators/existing_username_validator.rb' + - 'app/validators/follow_limit_validator.rb' + - 'app/validators/import_validator.rb' + - 'app/validators/language_validator.rb' + - 'app/validators/note_length_validator.rb' + - 'app/validators/poll_validator.rb' + - 'app/validators/reaction_validator.rb' + - 'app/validators/registration_form_time_validator.rb' + - 'app/validators/status_length_validator.rb' + - 'app/validators/status_pin_validator.rb' + - 'app/validators/unique_username_validator.rb' + - 'app/validators/unreserved_username_validator.rb' + - 'app/validators/url_validator.rb' + - 'app/validators/vote_validator.rb' + - 'app/workers/account_deletion_worker.rb' + - 'app/workers/account_merging_worker.rb' + - 'app/workers/activitypub/account_raw_distribution_worker.rb' + - 'app/workers/activitypub/delivery_worker.rb' + - 'app/workers/activitypub/distribute_poll_update_worker.rb' + - 'app/workers/activitypub/distribution_worker.rb' + - 'app/workers/activitypub/fetch_replies_worker.rb' + - 'app/workers/activitypub/followers_synchronization_worker.rb' + - 'app/workers/activitypub/low_priority_delivery_worker.rb' + - 'app/workers/activitypub/migrated_follow_delivery_worker.rb' + - 'app/workers/activitypub/move_distribution_worker.rb' + - 'app/workers/activitypub/post_upgrade_worker.rb' + - 'app/workers/activitypub/processing_worker.rb' + - 'app/workers/activitypub/raw_distribution_worker.rb' + - 'app/workers/activitypub/status_update_distribution_worker.rb' + - 'app/workers/activitypub/synchronize_featured_collection_worker.rb' + - 'app/workers/activitypub/synchronize_featured_tags_collection_worker.rb' + - 'app/workers/activitypub/update_distribution_worker.rb' + - 'app/workers/admin/account_deletion_worker.rb' + - 'app/workers/admin/domain_purge_worker.rb' + - 'app/workers/admin/suspension_worker.rb' + - 'app/workers/admin/unsuspension_worker.rb' + - 'app/workers/after_account_domain_block_worker.rb' + - 'app/workers/after_unallow_domain_worker.rb' + - 'app/workers/authorize_follow_worker.rb' + - 'app/workers/backup_worker.rb' + - 'app/workers/block_worker.rb' + - 'app/workers/bootstrap_timeline_worker.rb' + - 'app/workers/cache_buster_worker.rb' + - 'app/workers/concerns/exponential_backoff.rb' + - 'app/workers/delete_mute_worker.rb' + - 'app/workers/distribution_worker.rb' + - 'app/workers/domain_block_worker.rb' + - 'app/workers/domain_clear_media_worker.rb' + - 'app/workers/feed_insert_worker.rb' + - 'app/workers/fetch_reply_worker.rb' + - 'app/workers/import/relationship_worker.rb' + - 'app/workers/import_worker.rb' + - 'app/workers/link_crawl_worker.rb' + - 'app/workers/local_notification_worker.rb' + - 'app/workers/merge_worker.rb' + - 'app/workers/move_worker.rb' + - 'app/workers/mute_worker.rb' + - 'app/workers/poll_expiration_notify_worker.rb' + - 'app/workers/post_process_media_worker.rb' + - 'app/workers/publish_announcement_reaction_worker.rb' + - 'app/workers/publish_scheduled_announcement_worker.rb' + - 'app/workers/publish_scheduled_status_worker.rb' + - 'app/workers/push_conversation_worker.rb' + - 'app/workers/push_encrypted_message_worker.rb' + - 'app/workers/push_update_worker.rb' + - 'app/workers/redownload_avatar_worker.rb' + - 'app/workers/redownload_header_worker.rb' + - 'app/workers/redownload_media_worker.rb' + - 'app/workers/refollow_worker.rb' + - 'app/workers/regeneration_worker.rb' + - 'app/workers/remote_account_refresh_worker.rb' + - 'app/workers/removal_worker.rb' + - 'app/workers/remove_featured_tag_worker.rb' + - 'app/workers/resolve_account_worker.rb' + - 'app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb' + - 'app/workers/scheduler/follow_recommendations_scheduler.rb' + - 'app/workers/scheduler/indexing_scheduler.rb' + - 'app/workers/scheduler/instance_refresh_scheduler.rb' + - 'app/workers/scheduler/ip_cleanup_scheduler.rb' + - 'app/workers/scheduler/pghero_scheduler.rb' + - 'app/workers/scheduler/scheduled_statuses_scheduler.rb' + - 'app/workers/scheduler/suspended_user_cleanup_scheduler.rb' + - 'app/workers/scheduler/trends/refresh_scheduler.rb' + - 'app/workers/scheduler/trends/review_notifications_scheduler.rb' + - 'app/workers/scheduler/user_cleanup_scheduler.rb' + - 'app/workers/scheduler/vacuum_scheduler.rb' + - 'app/workers/thread_resolve_worker.rb' + - 'app/workers/trigger_webhook_worker.rb' + - 'app/workers/unfavourite_worker.rb' + - 'app/workers/unfollow_follow_worker.rb' + - 'app/workers/unmerge_worker.rb' + - 'app/workers/unpublish_announcement_worker.rb' + - 'app/workers/verify_account_links_worker.rb' + - 'app/workers/web/push_notification_worker.rb' + - 'app/workers/webhooks/delivery_worker.rb' + - 'db/migrate/20160220174730_create_accounts.rb' + - 'db/migrate/20160220211917_create_statuses.rb' + - 'db/migrate/20160221003140_create_users.rb' + - 'db/migrate/20160221003621_create_follows.rb' + - 'db/migrate/20160222122600_create_stream_entries.rb' + - 'db/migrate/20160222143943_add_profile_fields_to_accounts.rb' + - 'db/migrate/20160223162837_add_metadata_to_statuses.rb' + - 'db/migrate/20160223164502_make_uris_nullable_in_statuses.rb' + - 'db/migrate/20160223165723_add_url_to_statuses.rb' + - 'db/migrate/20160223165855_add_url_to_accounts.rb' + - 'db/migrate/20160223171800_create_favourites.rb' + - 'db/migrate/20160224223247_create_mentions.rb' + - 'db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb' + - 'db/migrate/20160305115639_add_devise_to_users.rb' + - 'db/migrate/20160306172223_create_doorkeeper_tables.rb' + - 'db/migrate/20160312193225_add_attachment_header_to_accounts.rb' + - 'db/migrate/20160314164231_add_owner_to_application.rb' + - 'db/migrate/20160316103650_add_missing_indices.rb' + - 'db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb' + - 'db/migrate/20160325130944_add_admin_to_users.rb' + - 'db/migrate/20160826155805_add_superapp_to_oauth_applications.rb' + - 'db/migrate/20160905150353_create_media_attachments.rb' + - 'db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb' + - 'db/migrate/20160920003904_remove_verify_token_from_accounts.rb' + - 'db/migrate/20160926213048_remove_owner_from_application.rb' + - 'db/migrate/20161003142332_add_confirmable_to_users.rb' + - 'db/migrate/20161003145426_create_blocks.rb' + - 'db/migrate/20161006213403_rails_settings_migration.rb' + - 'db/migrate/20161009120834_create_domain_blocks.rb' + - 'db/migrate/20161027172456_add_silenced_to_accounts.rb' + - 'db/migrate/20161104173623_create_tags.rb' + - 'db/migrate/20161105130633_create_statuses_tags_join_table.rb' + - 'db/migrate/20161116162355_add_locale_to_users.rb' + - 'db/migrate/20161119211120_create_notifications.rb' + - 'db/migrate/20161122163057_remove_unneeded_indexes.rb' + - 'db/migrate/20161123093447_add_sensitive_to_statuses.rb' + - 'db/migrate/20161128103007_create_subscriptions.rb' + - 'db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb' + - 'db/migrate/20161130185319_add_visibility_to_statuses.rb' + - 'db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb' + - 'db/migrate/20161203164520_add_from_account_id_to_notifications.rb' + - 'db/migrate/20161205214545_add_suspended_to_accounts.rb' + - 'db/migrate/20161221152630_add_hidden_to_stream_entries.rb' + - 'db/migrate/20161222201034_add_locked_to_accounts.rb' + - 'db/migrate/20161222204147_create_follow_requests.rb' + - 'db/migrate/20170105224407_add_shortcode_to_media_attachments.rb' + - 'db/migrate/20170109120109_create_web_settings.rb' + - 'db/migrate/20170112154826_migrate_settings.rb' + - 'db/migrate/20170114194937_add_application_to_statuses.rb' + - 'db/migrate/20170114203041_add_website_to_oauth_application.rb' + - 'db/migrate/20170119214911_create_preview_cards.rb' + - 'db/migrate/20170123162658_add_severity_to_domain_blocks.rb' + - 'db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb' + - 'db/migrate/20170125145934_add_spoiler_text_to_statuses.rb' + - 'db/migrate/20170127165745_add_devise_two_factor_to_users.rb' + - 'db/migrate/20170205175257_remove_devices.rb' + - 'db/migrate/20170209184350_add_reply_to_statuses.rb' + - 'db/migrate/20170214110202_create_reports.rb' + - 'db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb' + - 'db/migrate/20170301222600_create_mutes.rb' + - 'db/migrate/20170303212857_add_last_emailed_at_to_users.rb' + - 'db/migrate/20170304202101_add_type_to_media_attachments.rb' + - 'db/migrate/20170317193015_add_search_index_to_accounts.rb' + - 'db/migrate/20170318214217_add_header_remote_url_to_accounts.rb' + - 'db/migrate/20170322021028_add_lowercase_index_to_accounts.rb' + - 'db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb' + - 'db/migrate/20170322162804_add_search_index_to_tags.rb' + - 'db/migrate/20170330021336_add_counter_caches.rb' + - 'db/migrate/20170330163835_create_imports.rb' + - 'db/migrate/20170330164118_add_attachment_data_to_imports.rb' + - 'db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb' + - 'db/migrate/20170405112956_add_index_on_mentions_status_id.rb' + - 'db/migrate/20170406215816_add_notifications_and_favourites_indices.rb' + - 'db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb' + - 'db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb' + - 'db/migrate/20170414132105_add_language_to_statuses.rb' + - 'db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb' + - 'db/migrate/20170423005413_add_allowed_languages_to_user.rb' + - 'db/migrate/20170424003227_create_account_domain_blocks.rb' + - 'db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb' + - 'db/migrate/20170425131920_add_media_attachment_meta.rb' + - 'db/migrate/20170425202925_add_oembed_to_preview_cards.rb' + - 'db/migrate/20170427011934_re_add_owner_to_application.rb' + - 'db/migrate/20170506235850_create_conversations.rb' + - 'db/migrate/20170507000211_add_conversation_id_to_statuses.rb' + - 'db/migrate/20170507141759_optimize_index_subscriptions.rb' + - 'db/migrate/20170508230434_create_conversation_mutes.rb' + - 'db/migrate/20170516072309_add_index_accounts_on_uri.rb' + - 'db/migrate/20170520145338_change_language_filter_to_opt_out.rb' + - 'db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb' + - 'db/migrate/20170604144747_add_foreign_keys_for_accounts.rb' + - 'db/migrate/20170606113804_change_tag_search_index_to_btree.rb' + - 'db/migrate/20170609145826_remove_default_language_from_statuses.rb' + - 'db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb' + - 'db/migrate/20170623152212_create_session_activations.rb' + - 'db/migrate/20170624134742_add_description_to_session_activations.rb' + - 'db/migrate/20170625140443_add_access_token_id_to_session_activations.rb' + - 'db/migrate/20170711225116_fix_null_booleans.rb' + - 'db/migrate/20170713112503_make_tag_search_case_insensitive.rb' + - 'db/migrate/20170713175513_create_web_push_subscriptions.rb' + - 'db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb' + - 'db/migrate/20170714184731_add_domain_to_subscriptions.rb' + - 'db/migrate/20170716191202_add_hide_notifications_to_mute.rb' + - 'db/migrate/20170718211102_add_activitypub_to_accounts.rb' + - 'db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb' + - 'db/migrate/20170823162448_create_status_pins.rb' + - 'db/migrate/20170824103029_add_timestamps_to_status_pins.rb' + - 'db/migrate/20170829215220_remove_status_pins_account_index.rb' + - 'db/migrate/20170901141119_truncate_preview_cards.rb' + - 'db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb' + - 'db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb' + - 'db/migrate/20170905165803_add_local_to_statuses.rb' + - 'db/migrate/20170913000752_create_site_uploads.rb' + - 'db/migrate/20170917153509_create_custom_emojis.rb' + - 'db/migrate/20170918125918_ids_to_bigints.rb' + - 'db/migrate/20170920024819_status_ids_to_timestamp_ids.rb' + - 'db/migrate/20170920032311_fix_reblogs_in_feeds.rb' + - 'db/migrate/20170924022025_ids_to_bigints2.rb' + - 'db/migrate/20170927215609_add_description_to_media_attachments.rb' + - 'db/migrate/20170928082043_create_email_domain_blocks.rb' + - 'db/migrate/20171005102658_create_account_moderation_notes.rb' + - 'db/migrate/20171005171936_add_disabled_to_custom_emojis.rb' + - 'db/migrate/20171006142024_add_uri_to_custom_emojis.rb' + - 'db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb' + - 'db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb' + - 'db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb' + - 'db/migrate/20171028221157_add_reblogs_to_follows.rb' + - 'db/migrate/20171107143332_add_memorial_to_accounts.rb' + - 'db/migrate/20171107143624_add_disabled_to_users.rb' + - 'db/migrate/20171109012327_add_moderator_to_accounts.rb' + - 'db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb' + - 'db/migrate/20171114231651_create_lists.rb' + - 'db/migrate/20171116161857_create_list_accounts.rb' + - 'db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb' + - 'db/migrate/20171119172437_create_admin_action_logs.rb' + - 'db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb' + - 'db/migrate/20171125024930_create_invites.rb' + - 'db/migrate/20171125031751_add_invite_id_to_users.rb' + - 'db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb' + - 'db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb' + - 'db/migrate/20171129172043_add_index_on_stream_entries.rb' + - 'db/migrate/20171130000000_add_embed_url_to_preview_cards.rb' + - 'db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb' + - 'db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb' + - 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' + - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' + - 'db/migrate/20180109143959_add_remember_token_to_users.rb' + - 'db/migrate/20180204034416_create_identities.rb' + - 'db/migrate/20180206000000_change_user_id_nonnullable.rb' + - 'db/migrate/20180211015820_create_backups.rb' + - 'db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb' + - 'db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb' + - 'db/migrate/20180402031200_add_assigned_account_id_to_reports.rb' + - 'db/migrate/20180402040909_create_report_notes.rb' + - 'db/migrate/20180410204633_add_fields_to_accounts.rb' + - 'db/migrate/20180416210259_add_uri_to_relationships.rb' + - 'db/migrate/20180506221944_add_actor_type_to_accounts.rb' + - 'db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb' + - 'db/migrate/20180510230049_migrate_web_push_subscriptions.rb' + - 'db/migrate/20180514130000_improve_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' + - 'db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb' + - 'db/migrate/20180528141303_fix_accounts_unique_index.rb' + - 'db/migrate/20180608213548_reject_following_blocked_users.rb' + - 'db/migrate/20180609104432_migrate_web_push_subscriptions2.rb' + - 'db/migrate/20180615122121_add_autofollow_to_invites.rb' + - 'db/migrate/20180616192031_add_chosen_languages_to_users.rb' + - 'db/migrate/20180617162849_remove_unused_indexes.rb' + - 'db/migrate/20180628181026_create_custom_filters.rb' + - 'db/migrate/20180707154237_add_whole_word_to_custom_filter.rb' + - 'db/migrate/20180711152640_create_relays.rb' + - 'db/migrate/20180808175627_create_account_pins.rb' + - 'db/migrate/20180812123222_change_relays_enabled.rb' + - 'db/migrate/20180812162710_create_status_stats.rb' + - 'db/migrate/20180812173710_copy_status_stats.rb' + - 'db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb' + - 'db/migrate/20180820232245_add_foreign_key_indices.rb' + - 'db/migrate/20180831171112_create_bookmarks.rb' + - 'db/migrate/20180929222014_create_account_conversations.rb' + - 'db/migrate/20181007025445_create_pghero_space_stats.rb' + - 'db/migrate/20181010141500_add_silent_to_mentions.rb' + - 'db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb' + - 'db/migrate/20181018205649_add_unread_to_account_conversations.rb' + - 'db/migrate/20181024224956_migrate_account_conversations.rb' + - 'db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb' + - 'db/migrate/20181116165755_create_account_stats.rb' + - 'db/migrate/20181116173541_copy_account_stats.rb' + - 'db/migrate/20181127130500_identity_id_to_bigint.rb' + - 'db/migrate/20181127165847_add_show_replies_to_lists.rb' + - 'db/migrate/20181203003808_create_accounts_tags_join_table.rb' + - 'db/migrate/20181203021853_add_discoverable_to_accounts.rb' + - 'db/migrate/20181204193439_add_last_status_at_to_account_stats.rb' + - 'db/migrate/20181204215309_create_account_tag_stats.rb' + - 'db/migrate/20181207011115_downcase_custom_emoji_domains.rb' + - 'db/migrate/20181213184704_create_account_warnings.rb' + - 'db/migrate/20181213185533_create_account_warning_presets.rb' + - 'db/migrate/20181219235220_add_created_by_application_id_to_users.rb' + - 'db/migrate/20181226021420_add_also_known_as_to_accounts.rb' + - 'db/migrate/20190103124649_create_scheduled_statuses.rb' + - 'db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb' + - 'db/migrate/20190117114553_create_tombstones.rb' + - 'db/migrate/20190201012802_add_overwrite_to_imports.rb' + - 'db/migrate/20190203180359_create_featured_tags.rb' + - 'db/migrate/20190225031541_create_polls.rb' + - 'db/migrate/20190225031625_create_poll_votes.rb' + - 'db/migrate/20190226003449_add_poll_id_to_statuses.rb' + - 'db/migrate/20190304152020_add_uri_to_poll_votes.rb' + - 'db/migrate/20190306145741_add_lock_version_to_polls.rb' + - 'db/migrate/20190307234537_add_approved_to_users.rb' + - 'db/migrate/20190314181829_migrate_open_registrations_setting.rb' + - 'db/migrate/20190316190352_create_account_identity_proofs.rb' + - 'db/migrate/20190317135723_add_uri_to_reports.rb' + - 'db/migrate/20190403141604_add_comment_to_invites.rb' + - 'db/migrate/20190409054914_create_user_invite_requests.rb' + - 'db/migrate/20190420025523_add_blurhash_to_media_attachments.rb' + - 'db/migrate/20190509164208_add_by_moderator_to_tombstone.rb' + - 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' + - 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb' + - 'db/migrate/20190627222225_create_custom_emoji_categories.rb' + - 'db/migrate/20190627222826_add_category_id_to_custom_emojis.rb' + - 'db/migrate/20190701022101_add_trust_level_to_accounts.rb' + - 'db/migrate/20190705002136_create_domain_allows.rb' + - 'db/migrate/20190715164535_add_instance_actor.rb' + - 'db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb' + - 'db/migrate/20190729185330_add_score_to_tags.rb' + - 'db/migrate/20190805123746_add_capabilities_to_tags.rb' + - 'db/migrate/20190807135426_add_comments_to_domain_blocks.rb' + - 'db/migrate/20190815225426_add_last_status_at_to_tags.rb' + - 'db/migrate/20190819134503_add_deleted_at_to_statuses.rb' + - 'db/migrate/20190820003045_update_statuses_index.rb' + - 'db/migrate/20190823221802_add_local_index_to_statuses.rb' + - 'db/migrate/20190901035623_add_max_score_to_tags.rb' + - 'db/migrate/20190904222339_create_markers.rb' + - 'db/migrate/20190914202517_create_account_migrations.rb' + - 'db/migrate/20190915194355_create_account_aliases.rb' + - 'db/migrate/20190917213523_add_remember_token_index.rb' + - 'db/migrate/20190927232842_add_voters_count_to_polls.rb' + - 'db/migrate/20191001213028_add_lock_version_to_account_stats.rb' + - 'db/migrate/20191007013357_update_pt_locales.rb' + - 'db/migrate/20191031163205_change_list_account_follow_nullable.rb' + - 'db/migrate/20191212003415_increase_backup_size.rb' + - 'db/migrate/20191212163405_add_hide_collections_to_accounts.rb' + - 'db/migrate/20191218153258_create_announcements.rb' + - 'db/migrate/20200113125135_create_announcement_mutes.rb' + - 'db/migrate/20200114113335_create_announcement_reactions.rb' + - 'db/migrate/20200119112504_add_public_index_to_statuses.rb' + - 'db/migrate/20200126203551_add_published_at_to_announcements.rb' + - 'db/migrate/20200306035625_add_processing_to_media_attachments.rb' + - 'db/migrate/20200309150742_add_forwarded_to_reports.rb' + - 'db/migrate/20200312144258_add_title_to_account_warning_presets.rb' + - 'db/migrate/20200312162302_add_status_ids_to_announcements.rb' + - 'db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb' + - 'db/migrate/20200317021758_add_expires_at_to_mutes.rb' + - 'db/migrate/20200407201300_create_unavailable_domains.rb' + - 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb' + - 'db/migrate/20200417125749_add_storage_schema_version.rb' + - 'db/migrate/20200508212852_reset_unique_jobs_locks.rb' + - 'db/migrate/20200510110808_reset_web_app_secret.rb' + - 'db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb' + - 'db/migrate/20200516180352_create_devices.rb' + - 'db/migrate/20200516183822_create_one_time_keys.rb' + - 'db/migrate/20200518083523_create_encrypted_messages.rb' + - 'db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb' + - 'db/migrate/20200529214050_add_devices_url_to_accounts.rb' + - 'db/migrate/20200601222558_create_system_keys.rb' + - 'db/migrate/20200605155027_add_blurhash_to_preview_cards.rb' + - 'db/migrate/20200608113046_add_sign_in_token_to_users.rb' + - 'db/migrate/20200614002136_add_sensitized_to_accounts.rb' + - 'db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb' + - 'db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb' + - 'db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb' + - 'db/migrate/20200628133322_create_account_notes.rb' + - 'db/migrate/20200630190240_create_webauthn_credentials.rb' + - 'db/migrate/20200630190544_add_webauthn_id_to_users.rb' + - 'db/migrate/20200908193330_create_account_deletion_requests.rb' + - 'db/migrate/20200917192924_add_notify_to_follows.rb' + - 'db/migrate/20200917193034_add_type_to_notifications.rb' + - 'db/migrate/20200917222316_add_index_notifications_on_type.rb' + - 'db/migrate/20201008202037_create_ip_blocks.rb' + - 'db/migrate/20201008220312_add_sign_up_ip_to_users.rb' + - 'db/migrate/20201017233919_add_suspension_origin_to_accounts.rb' + - 'db/migrate/20201206004238_create_instances.rb' + - 'db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb' + - 'db/migrate/20210221045109_create_rules.rb' + - 'db/migrate/20210306164523_account_ids_to_timestamp_ids.rb' + - 'db/migrate/20210322164601_create_account_summaries.rb' + - 'db/migrate/20210323114347_create_follow_recommendations.rb' + - 'db/migrate/20210324171613_create_follow_recommendation_suppressions.rb' + - 'db/migrate/20210416200740_create_canonical_email_blocks.rb' + - 'db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb' + - 'db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb' + - 'db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb' + - 'db/migrate/20210609202149_create_login_activities.rb' + - 'db/migrate/20210616214526_create_user_ips.rb' + - 'db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb' + - 'db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb' + - 'db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb' + - 'db/migrate/20210904215403_add_edited_at_to_statuses.rb' + - 'db/migrate/20210908220918_create_status_edits.rb' + - 'db/migrate/20211031031021_create_preview_card_providers.rb' + - 'db/migrate/20211112011713_add_language_to_preview_cards.rb' + - 'db/migrate/20211115032527_add_trendable_to_preview_cards.rb' + - 'db/migrate/20211123212714_add_link_type_to_preview_cards.rb' + - 'db/migrate/20211213040746_update_account_summaries_to_version_2.rb' + - 'db/migrate/20211231080958_add_category_to_reports.rb' + - 'db/migrate/20220105163928_remove_mentions_status_id_index.rb' + - 'db/migrate/20220115125126_add_report_id_to_account_warnings.rb' + - 'db/migrate/20220115125341_fix_account_warning_actions.rb' + - 'db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb' + - 'db/migrate/20220124141035_create_appeals.rb' + - 'db/migrate/20220202200743_add_trendable_to_accounts.rb' + - 'db/migrate/20220202200926_add_trendable_to_statuses.rb' + - 'db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb' + - 'db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb' + - 'db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb' + - 'db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb' + - 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' + - 'db/migrate/20220304195405_migrate_hide_network_preference.rb' + - 'db/migrate/20220307094650_fix_featured_tags_constraints.rb' + - 'db/migrate/20220309213005_fix_reblog_deleted_at.rb' + - 'db/migrate/20220316233212_update_kurdish_locales.rb' + - 'db/migrate/20220428112511_add_index_statuses_on_account_id.rb' + - 'db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb' + - 'db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb' + - 'db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb' + - 'db/migrate/20220606044941_create_webhooks.rb' + - 'db/migrate/20220611210335_create_user_roles.rb' + - 'db/migrate/20220611212541_add_role_id_to_users.rb' + - 'db/migrate/20220613110628_create_custom_filter_keywords.rb' + - 'db/migrate/20220613110711_migrate_custom_filters.rb' + - 'db/migrate/20220613110834_add_action_to_custom_filters.rb' + - 'db/migrate/20220710102457_add_display_name_to_tags.rb' + - 'db/migrate/20220714171049_create_tag_follows.rb' + - 'db/migrate/20220808101323_create_custom_filter_statuses.rb' + - 'db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb' + - 'db/migrate/20220824233535_create_status_trends.rb' + - 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' + - 'db/migrate/20220829192633_add_languages_to_follows.rb' + - 'db/migrate/20220829192658_add_languages_to_follow_requests.rb' + - 'db/migrate/20221006061337_create_preview_card_trends.rb' + - 'db/migrate/20221012181003_add_blurhash_to_site_uploads.rb' + - 'db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb' + - 'db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb' + - 'db/migrate/20221104133904_add_name_to_featured_tags.rb' + - 'db/post_migrate/20180813113448_copy_status_stats_cleanup.rb' + - 'db/post_migrate/20181116184611_copy_account_stats_cleanup.rb' + - 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb' + - 'db/post_migrate/20190519130537_remove_boosts_widening_audience.rb' + - 'db/post_migrate/20190706233204_drop_stream_entries.rb' + - 'db/post_migrate/20190715031050_drop_subscriptions.rb' + - 'db/post_migrate/20190901040524_remove_score_from_tags.rb' + - 'db/post_migrate/20190927124642_remove_invalid_web_push_subscription.rb' + - 'db/post_migrate/20200917193528_migrate_notifications_type.rb' + - 'db/post_migrate/20200917222734_remove_index_notifications_on_account_activity.rb' + - 'db/post_migrate/20201017234926_fill_account_suspension_origin.rb' + - 'db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb' + - 'db/post_migrate/20210502233513_drop_account_tag_stats.rb' + - 'db/post_migrate/20210507001928_remove_hub_url_from_accounts.rb' + - 'db/post_migrate/20210526193025_remove_lock_version_from_account_stats.rb' + - 'db/post_migrate/20210616214135_remove_current_sign_in_ip_from_users.rb' + - 'db/post_migrate/20210808071221_clear_orphaned_account_notes.rb' + - 'db/post_migrate/20211126000907_drop_account_identity_proofs.rb' + - 'db/post_migrate/20220109213908_remove_action_taken_from_reports.rb' + - 'db/post_migrate/20220118183010_remove_index_users_on_remember_token.rb' + - 'db/post_migrate/20220118183123_remove_rememberable_from_users.rb' + - 'db/post_migrate/20220202201015_remove_trust_level_from_accounts.rb' + - 'db/post_migrate/20220303203437_remove_media_attachments_changed_from_status_edits.rb' + - 'db/post_migrate/20220307083603_optimize_null_index_conversations_uri.rb' + - 'db/post_migrate/20220310060545_optimize_null_index_statuses_in_reply_to_account_id.rb' + - 'db/post_migrate/20220310060556_optimize_null_index_statuses_in_reply_to_id.rb' + - 'db/post_migrate/20220310060614_optimize_null_index_media_attachments_scheduled_status_id.rb' + - 'db/post_migrate/20220310060626_optimize_null_index_media_attachments_shortcode.rb' + - 'db/post_migrate/20220310060641_optimize_null_index_users_reset_password_token.rb' + - 'db/post_migrate/20220310060653_optimize_null_index_users_created_by_application_id.rb' + - 'db/post_migrate/20220310060706_optimize_null_index_statuses_uri.rb' + - 'db/post_migrate/20220310060722_optimize_null_index_accounts_moved_to_account_id.rb' + - 'db/post_migrate/20220310060740_optimize_null_index_oauth_access_tokens_refresh_token.rb' + - 'db/post_migrate/20220310060750_optimize_null_index_accounts_url.rb' + - 'db/post_migrate/20220310060809_optimize_null_index_oauth_access_tokens_resource_owner_id.rb' + - 'db/post_migrate/20220310060833_optimize_null_index_announcement_reactions_custom_emoji_id.rb' + - 'db/post_migrate/20220310060854_optimize_null_index_appeals_approved_by_account_id.rb' + - 'db/post_migrate/20220310060913_optimize_null_index_account_migrations_target_account_id.rb' + - 'db/post_migrate/20220310060926_optimize_null_index_appeals_rejected_by_account_id.rb' + - 'db/post_migrate/20220310060939_optimize_null_index_list_accounts_follow_id.rb' + - 'db/post_migrate/20220310060959_optimize_null_index_web_push_subscriptions_access_token_id.rb' + - 'db/post_migrate/20220429101025_remove_ips_from_email_domain_blocks.rb' + - 'db/post_migrate/20220429101850_clear_email_domain_blocks.rb' + - 'db/post_migrate/20220527114923_remove_filtered_languages_from_users.rb' + - 'db/post_migrate/20220613110802_remove_whole_word_from_custom_filters.rb' + - 'db/post_migrate/20220613110903_remove_irreversible_from_custom_filters.rb' + - 'db/post_migrate/20220617202502_migrate_roles.rb' + - 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb' + - 'db/post_migrate/20220729171123_fix_custom_filter_keywords_id_seq.rb' + - 'db/post_migrate/20220824164532_remove_recorded_changes_from_admin_action_logs.rb' + - 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb' + - 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb' + - 'lib/active_record/batches.rb' + - 'lib/active_record/database_tasks_extensions.rb' + - 'lib/chewy/strategy/mastodon.rb' + - 'lib/cli.rb' + - 'lib/devise/two_factor_ldap_authenticatable.rb' + - 'lib/devise/two_factor_pam_authenticatable.rb' + - 'lib/exceptions.rb' + - 'lib/generators/post_deployment_migration_generator.rb' + - 'lib/mastodon/accounts_cli.rb' + - 'lib/mastodon/cache_cli.rb' + - 'lib/mastodon/canonical_email_blocks_cli.rb' + - 'lib/mastodon/cli_helper.rb' + - 'lib/mastodon/domains_cli.rb' + - 'lib/mastodon/email_domain_blocks_cli.rb' + - 'lib/mastodon/emoji_cli.rb' + - 'lib/mastodon/feeds_cli.rb' + - 'lib/mastodon/ip_blocks_cli.rb' + - 'lib/mastodon/maintenance_cli.rb' + - 'lib/mastodon/media_cli.rb' + - 'lib/mastodon/premailer_webpack_strategy.rb' + - 'lib/mastodon/preview_cards_cli.rb' + - 'lib/mastodon/rack_middleware.rb' + - 'lib/mastodon/search_cli.rb' + - 'lib/mastodon/settings_cli.rb' + - 'lib/mastodon/sidekiq_middleware.rb' + - 'lib/mastodon/snowflake.rb' + - 'lib/mastodon/statuses_cli.rb' + - 'lib/mastodon/upgrade_cli.rb' + - 'lib/mastodon/version.rb' + - 'lib/paperclip/attachment_extensions.rb' + - 'lib/paperclip/blurhash_transcoder.rb' + - 'lib/paperclip/color_extractor.rb' + - 'lib/paperclip/gif_transcoder.rb' + - 'lib/paperclip/image_extractor.rb' + - 'lib/paperclip/lazy_thumbnail.rb' + - 'lib/paperclip/response_with_limit_adapter.rb' + - 'lib/paperclip/type_corrector.rb' + - 'lib/paperclip/url_generator_extensions.rb' + - 'lib/public_file_server_middleware.rb' + - 'lib/rails/engine_extensions.rb' + - 'lib/redis/namespace_extensions.rb' + - 'lib/sanitize_ext/sanitize_config.rb' + - 'lib/simple_navigation/item_extensions.rb' + - 'lib/terrapin/multi_pipe_extensions.rb' + - 'lib/webpacker/helper_extensions.rb' + - 'lib/webpacker/manifest_extensions.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedVars. +Style/FetchEnvVar: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/lib/redis_configuration.rb' + - 'app/lib/translation_service.rb' + - 'lib/mastodon/premailer_webpack_strategy.rb' + - 'lib/mastodon/redis_config.rb' + - 'lib/tasks/repo.rake' + - 'spec/features/profile_spec.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. +# SupportedStyles: annotated, template, unannotated +Style/FormatStringToken: + Exclude: + - 'app/models/privacy_policy.rb' + - 'lib/mastodon/maintenance_cli.rb' + - 'lib/paperclip/color_extractor.rb' + +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Exclude: + - 'app/views/accounts/show.rss.ruby' + - 'app/views/tags/show.rss.ruby' + - 'app/views/well_known/host_meta/show.xml.ruby' + - 'db/migrate/20160220174730_create_accounts.rb' + - 'db/migrate/20160220211917_create_statuses.rb' + - 'db/migrate/20160221003140_create_users.rb' + - 'db/migrate/20160221003621_create_follows.rb' + - 'db/migrate/20160222122600_create_stream_entries.rb' + - 'db/migrate/20160222143943_add_profile_fields_to_accounts.rb' + - 'db/migrate/20160223162837_add_metadata_to_statuses.rb' + - 'db/migrate/20160223164502_make_uris_nullable_in_statuses.rb' + - 'db/migrate/20160223165723_add_url_to_statuses.rb' + - 'db/migrate/20160223165855_add_url_to_accounts.rb' + - 'db/migrate/20160223171800_create_favourites.rb' + - 'db/migrate/20160224223247_create_mentions.rb' + - 'db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb' + - 'db/migrate/20160305115639_add_devise_to_users.rb' + - 'db/migrate/20160306172223_create_doorkeeper_tables.rb' + - 'db/migrate/20160312193225_add_attachment_header_to_accounts.rb' + - 'db/migrate/20160314164231_add_owner_to_application.rb' + - 'db/migrate/20160316103650_add_missing_indices.rb' + - 'db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb' + - 'db/migrate/20160325130944_add_admin_to_users.rb' + - 'db/migrate/20160826155805_add_superapp_to_oauth_applications.rb' + - 'db/migrate/20160905150353_create_media_attachments.rb' + - 'db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb' + - 'db/migrate/20160920003904_remove_verify_token_from_accounts.rb' + - 'db/migrate/20160926213048_remove_owner_from_application.rb' + - 'db/migrate/20161003142332_add_confirmable_to_users.rb' + - 'db/migrate/20161003145426_create_blocks.rb' + - 'db/migrate/20161006213403_rails_settings_migration.rb' + - 'db/migrate/20161009120834_create_domain_blocks.rb' + - 'db/migrate/20161027172456_add_silenced_to_accounts.rb' + - 'db/migrate/20161104173623_create_tags.rb' + - 'db/migrate/20161105130633_create_statuses_tags_join_table.rb' + - 'db/migrate/20161116162355_add_locale_to_users.rb' + - 'db/migrate/20161119211120_create_notifications.rb' + - 'db/migrate/20161122163057_remove_unneeded_indexes.rb' + - 'db/migrate/20161123093447_add_sensitive_to_statuses.rb' + - 'db/migrate/20161128103007_create_subscriptions.rb' + - 'db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb' + - 'db/migrate/20161130185319_add_visibility_to_statuses.rb' + - 'db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb' + - 'db/migrate/20161203164520_add_from_account_id_to_notifications.rb' + - 'db/migrate/20161205214545_add_suspended_to_accounts.rb' + - 'db/migrate/20161221152630_add_hidden_to_stream_entries.rb' + - 'db/migrate/20161222201034_add_locked_to_accounts.rb' + - 'db/migrate/20161222204147_create_follow_requests.rb' + - 'db/migrate/20170105224407_add_shortcode_to_media_attachments.rb' + - 'db/migrate/20170109120109_create_web_settings.rb' + - 'db/migrate/20170112154826_migrate_settings.rb' + - 'db/migrate/20170114194937_add_application_to_statuses.rb' + - 'db/migrate/20170114203041_add_website_to_oauth_application.rb' + - 'db/migrate/20170119214911_create_preview_cards.rb' + - 'db/migrate/20170123162658_add_severity_to_domain_blocks.rb' + - 'db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb' + - 'db/migrate/20170125145934_add_spoiler_text_to_statuses.rb' + - 'db/migrate/20170127165745_add_devise_two_factor_to_users.rb' + - 'db/migrate/20170205175257_remove_devices.rb' + - 'db/migrate/20170209184350_add_reply_to_statuses.rb' + - 'db/migrate/20170214110202_create_reports.rb' + - 'db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb' + - 'db/migrate/20170301222600_create_mutes.rb' + - 'db/migrate/20170303212857_add_last_emailed_at_to_users.rb' + - 'db/migrate/20170304202101_add_type_to_media_attachments.rb' + - 'db/migrate/20170317193015_add_search_index_to_accounts.rb' + - 'db/migrate/20170318214217_add_header_remote_url_to_accounts.rb' + - 'db/migrate/20170322021028_add_lowercase_index_to_accounts.rb' + - 'db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb' + - 'db/migrate/20170322162804_add_search_index_to_tags.rb' + - 'db/migrate/20170330021336_add_counter_caches.rb' + - 'db/migrate/20170330163835_create_imports.rb' + - 'db/migrate/20170330164118_add_attachment_data_to_imports.rb' + - 'db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb' + - 'db/migrate/20170405112956_add_index_on_mentions_status_id.rb' + - 'db/migrate/20170406215816_add_notifications_and_favourites_indices.rb' + - 'db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb' + - 'db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb' + - 'db/migrate/20170414132105_add_language_to_statuses.rb' + - 'db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb' + - 'db/migrate/20170423005413_add_allowed_languages_to_user.rb' + - 'db/migrate/20170424003227_create_account_domain_blocks.rb' + - 'db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb' + - 'db/migrate/20170425131920_add_media_attachment_meta.rb' + - 'db/migrate/20170425202925_add_oembed_to_preview_cards.rb' + - 'db/migrate/20170427011934_re_add_owner_to_application.rb' + - 'db/migrate/20170506235850_create_conversations.rb' + - 'db/migrate/20170507000211_add_conversation_id_to_statuses.rb' + - 'db/migrate/20170507141759_optimize_index_subscriptions.rb' + - 'db/migrate/20170508230434_create_conversation_mutes.rb' + - 'db/migrate/20170516072309_add_index_accounts_on_uri.rb' + - 'db/migrate/20170520145338_change_language_filter_to_opt_out.rb' + - 'db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb' + - 'db/migrate/20170604144747_add_foreign_keys_for_accounts.rb' + - 'db/migrate/20170606113804_change_tag_search_index_to_btree.rb' + - 'db/migrate/20170609145826_remove_default_language_from_statuses.rb' + - 'db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb' + - 'db/migrate/20170623152212_create_session_activations.rb' + - 'db/migrate/20170624134742_add_description_to_session_activations.rb' + - 'db/migrate/20170625140443_add_access_token_id_to_session_activations.rb' + - 'db/migrate/20170711225116_fix_null_booleans.rb' + - 'db/migrate/20170713112503_make_tag_search_case_insensitive.rb' + - 'db/migrate/20170713175513_create_web_push_subscriptions.rb' + - 'db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb' + - 'db/migrate/20170714184731_add_domain_to_subscriptions.rb' + - 'db/migrate/20170716191202_add_hide_notifications_to_mute.rb' + - 'db/migrate/20170718211102_add_activitypub_to_accounts.rb' + - 'db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb' + - 'db/migrate/20170823162448_create_status_pins.rb' + - 'db/migrate/20170824103029_add_timestamps_to_status_pins.rb' + - 'db/migrate/20170829215220_remove_status_pins_account_index.rb' + - 'db/migrate/20170901141119_truncate_preview_cards.rb' + - 'db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb' + - 'db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb' + - 'db/migrate/20170905165803_add_local_to_statuses.rb' + - 'db/migrate/20170913000752_create_site_uploads.rb' + - 'db/migrate/20170917153509_create_custom_emojis.rb' + - 'db/migrate/20170918125918_ids_to_bigints.rb' + - 'db/migrate/20170920024819_status_ids_to_timestamp_ids.rb' + - 'db/migrate/20170920032311_fix_reblogs_in_feeds.rb' + - 'db/migrate/20170924022025_ids_to_bigints2.rb' + - 'db/migrate/20170927215609_add_description_to_media_attachments.rb' + - 'db/migrate/20170928082043_create_email_domain_blocks.rb' + - 'db/migrate/20171005102658_create_account_moderation_notes.rb' + - 'db/migrate/20171005171936_add_disabled_to_custom_emojis.rb' + - 'db/migrate/20171006142024_add_uri_to_custom_emojis.rb' + - 'db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb' + - 'db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb' + - 'db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb' + - 'db/migrate/20171028221157_add_reblogs_to_follows.rb' + - 'db/migrate/20171107143332_add_memorial_to_accounts.rb' + - 'db/migrate/20171107143624_add_disabled_to_users.rb' + - 'db/migrate/20171109012327_add_moderator_to_accounts.rb' + - 'db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb' + - 'db/migrate/20171114231651_create_lists.rb' + - 'db/migrate/20171116161857_create_list_accounts.rb' + - 'db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb' + - 'db/migrate/20171119172437_create_admin_action_logs.rb' + - 'db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb' + - 'db/migrate/20171125024930_create_invites.rb' + - 'db/migrate/20171125031751_add_invite_id_to_users.rb' + - 'db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb' + - 'db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb' + - 'db/migrate/20171129172043_add_index_on_stream_entries.rb' + - 'db/migrate/20171130000000_add_embed_url_to_preview_cards.rb' + - 'db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb' + - 'db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb' + - 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' + - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' + - 'db/migrate/20180109143959_add_remember_token_to_users.rb' + - 'db/migrate/20180204034416_create_identities.rb' + - 'db/migrate/20180206000000_change_user_id_nonnullable.rb' + - 'db/migrate/20180211015820_create_backups.rb' + - 'db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb' + - 'db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb' + - 'db/migrate/20180402031200_add_assigned_account_id_to_reports.rb' + - 'db/migrate/20180402040909_create_report_notes.rb' + - 'db/migrate/20180410204633_add_fields_to_accounts.rb' + - 'db/migrate/20180416210259_add_uri_to_relationships.rb' + - 'db/migrate/20180506221944_add_actor_type_to_accounts.rb' + - 'db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb' + - 'db/migrate/20180510230049_migrate_web_push_subscriptions.rb' + - 'db/migrate/20180528141303_fix_accounts_unique_index.rb' + - 'db/migrate/20180608213548_reject_following_blocked_users.rb' + - 'db/migrate/20180609104432_migrate_web_push_subscriptions2.rb' + - 'db/migrate/20180615122121_add_autofollow_to_invites.rb' + - 'db/migrate/20180616192031_add_chosen_languages_to_users.rb' + - 'db/migrate/20180617162849_remove_unused_indexes.rb' + - 'db/migrate/20180628181026_create_custom_filters.rb' + - 'db/migrate/20180707154237_add_whole_word_to_custom_filter.rb' + - 'db/migrate/20180711152640_create_relays.rb' + - 'db/migrate/20180808175627_create_account_pins.rb' + - 'db/migrate/20180812123222_change_relays_enabled.rb' + - 'db/migrate/20180812162710_create_status_stats.rb' + - 'db/migrate/20180812173710_copy_status_stats.rb' + - 'db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb' + - 'db/migrate/20180831171112_create_bookmarks.rb' + - 'db/migrate/20180929222014_create_account_conversations.rb' + - 'db/migrate/20181007025445_create_pghero_space_stats.rb' + - 'db/migrate/20181010141500_add_silent_to_mentions.rb' + - 'db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb' + - 'db/migrate/20181018205649_add_unread_to_account_conversations.rb' + - 'db/migrate/20181024224956_migrate_account_conversations.rb' + - 'db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb' + - 'db/migrate/20181116165755_create_account_stats.rb' + - 'db/migrate/20181116173541_copy_account_stats.rb' + - 'db/migrate/20181127130500_identity_id_to_bigint.rb' + - 'db/migrate/20181127165847_add_show_replies_to_lists.rb' + - 'db/migrate/20181203003808_create_accounts_tags_join_table.rb' + - 'db/migrate/20181203021853_add_discoverable_to_accounts.rb' + - 'db/migrate/20181204193439_add_last_status_at_to_account_stats.rb' + - 'db/migrate/20181204215309_create_account_tag_stats.rb' + - 'db/migrate/20181207011115_downcase_custom_emoji_domains.rb' + - 'db/migrate/20181213184704_create_account_warnings.rb' + - 'db/migrate/20181213185533_create_account_warning_presets.rb' + - 'db/migrate/20181219235220_add_created_by_application_id_to_users.rb' + - 'db/migrate/20181226021420_add_also_known_as_to_accounts.rb' + - 'db/migrate/20190103124649_create_scheduled_statuses.rb' + - 'db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb' + - 'db/migrate/20190117114553_create_tombstones.rb' + - 'db/migrate/20190201012802_add_overwrite_to_imports.rb' + - 'db/migrate/20190203180359_create_featured_tags.rb' + - 'db/migrate/20190225031541_create_polls.rb' + - 'db/migrate/20190225031625_create_poll_votes.rb' + - 'db/migrate/20190226003449_add_poll_id_to_statuses.rb' + - 'db/migrate/20190304152020_add_uri_to_poll_votes.rb' + - 'db/migrate/20190306145741_add_lock_version_to_polls.rb' + - 'db/migrate/20190307234537_add_approved_to_users.rb' + - 'db/migrate/20190314181829_migrate_open_registrations_setting.rb' + - 'db/migrate/20190316190352_create_account_identity_proofs.rb' + - 'db/migrate/20190317135723_add_uri_to_reports.rb' + - 'db/migrate/20190403141604_add_comment_to_invites.rb' + - 'db/migrate/20190409054914_create_user_invite_requests.rb' + - 'db/migrate/20190420025523_add_blurhash_to_media_attachments.rb' + - 'db/migrate/20190509164208_add_by_moderator_to_tombstone.rb' + - 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' + - 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb' + - 'db/migrate/20190627222225_create_custom_emoji_categories.rb' + - 'db/migrate/20190627222826_add_category_id_to_custom_emojis.rb' + - 'db/migrate/20190701022101_add_trust_level_to_accounts.rb' + - 'db/migrate/20190705002136_create_domain_allows.rb' + - 'db/migrate/20190715164535_add_instance_actor.rb' + - 'db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb' + - 'db/migrate/20190729185330_add_score_to_tags.rb' + - 'db/migrate/20190805123746_add_capabilities_to_tags.rb' + - 'db/migrate/20190807135426_add_comments_to_domain_blocks.rb' + - 'db/migrate/20190815225426_add_last_status_at_to_tags.rb' + - 'db/migrate/20190819134503_add_deleted_at_to_statuses.rb' + - 'db/migrate/20190820003045_update_statuses_index.rb' + - 'db/migrate/20190823221802_add_local_index_to_statuses.rb' + - 'db/migrate/20190901035623_add_max_score_to_tags.rb' + - 'db/migrate/20190904222339_create_markers.rb' + - 'db/migrate/20190914202517_create_account_migrations.rb' + - 'db/migrate/20190915194355_create_account_aliases.rb' + - 'db/migrate/20190927232842_add_voters_count_to_polls.rb' + - 'db/migrate/20191001213028_add_lock_version_to_account_stats.rb' + - 'db/migrate/20191007013357_update_pt_locales.rb' + - 'db/migrate/20191031163205_change_list_account_follow_nullable.rb' + - 'db/migrate/20191212003415_increase_backup_size.rb' + - 'db/migrate/20191212163405_add_hide_collections_to_accounts.rb' + - 'db/migrate/20191218153258_create_announcements.rb' + - 'db/migrate/20200113125135_create_announcement_mutes.rb' + - 'db/migrate/20200114113335_create_announcement_reactions.rb' + - 'db/migrate/20200119112504_add_public_index_to_statuses.rb' + - 'db/migrate/20200126203551_add_published_at_to_announcements.rb' + - 'db/migrate/20200306035625_add_processing_to_media_attachments.rb' + - 'db/migrate/20200309150742_add_forwarded_to_reports.rb' + - 'db/migrate/20200312144258_add_title_to_account_warning_presets.rb' + - 'db/migrate/20200312162302_add_status_ids_to_announcements.rb' + - 'db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb' + - 'db/migrate/20200317021758_add_expires_at_to_mutes.rb' + - 'db/migrate/20200407201300_create_unavailable_domains.rb' + - 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb' + - 'db/migrate/20200417125749_add_storage_schema_version.rb' + - 'db/migrate/20200508212852_reset_unique_jobs_locks.rb' + - 'db/migrate/20200510110808_reset_web_app_secret.rb' + - 'db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb' + - 'db/migrate/20200516180352_create_devices.rb' + - 'db/migrate/20200516183822_create_one_time_keys.rb' + - 'db/migrate/20200518083523_create_encrypted_messages.rb' + - 'db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb' + - 'db/migrate/20200529214050_add_devices_url_to_accounts.rb' + - 'db/migrate/20200601222558_create_system_keys.rb' + - 'db/migrate/20200605155027_add_blurhash_to_preview_cards.rb' + - 'db/migrate/20200608113046_add_sign_in_token_to_users.rb' + - 'db/migrate/20200614002136_add_sensitized_to_accounts.rb' + - 'db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb' + - 'db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb' + - 'db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb' + - 'db/migrate/20200628133322_create_account_notes.rb' + - 'db/migrate/20200630190240_create_webauthn_credentials.rb' + - 'db/migrate/20200630190544_add_webauthn_id_to_users.rb' + - 'db/migrate/20200908193330_create_account_deletion_requests.rb' + - 'db/migrate/20200917192924_add_notify_to_follows.rb' + - 'db/migrate/20200917193034_add_type_to_notifications.rb' + - 'db/migrate/20200917222316_add_index_notifications_on_type.rb' + - 'db/migrate/20201008202037_create_ip_blocks.rb' + - 'db/migrate/20201008220312_add_sign_up_ip_to_users.rb' + - 'db/migrate/20201017233919_add_suspension_origin_to_accounts.rb' + - 'db/migrate/20201206004238_create_instances.rb' + - 'db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb' + - 'db/migrate/20210221045109_create_rules.rb' + - 'db/migrate/20210306164523_account_ids_to_timestamp_ids.rb' + - 'db/migrate/20210322164601_create_account_summaries.rb' + - 'db/migrate/20210323114347_create_follow_recommendations.rb' + - 'db/migrate/20210324171613_create_follow_recommendation_suppressions.rb' + - 'db/migrate/20210416200740_create_canonical_email_blocks.rb' + - 'db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb' + - 'db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb' + - 'db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb' + - 'db/migrate/20210609202149_create_login_activities.rb' + - 'db/migrate/20210616214526_create_user_ips.rb' + - 'db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb' + - 'db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb' + - 'db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb' + - 'db/migrate/20210904215403_add_edited_at_to_statuses.rb' + - 'db/migrate/20210908220918_create_status_edits.rb' + - 'db/migrate/20211031031021_create_preview_card_providers.rb' + - 'db/migrate/20211112011713_add_language_to_preview_cards.rb' + - 'db/migrate/20211115032527_add_trendable_to_preview_cards.rb' + - 'db/migrate/20211123212714_add_link_type_to_preview_cards.rb' + - 'db/migrate/20211213040746_update_account_summaries_to_version_2.rb' + - 'db/migrate/20211231080958_add_category_to_reports.rb' + - 'db/migrate/20220105163928_remove_mentions_status_id_index.rb' + - 'db/migrate/20220115125126_add_report_id_to_account_warnings.rb' + - 'db/migrate/20220115125341_fix_account_warning_actions.rb' + - 'db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb' + - 'db/migrate/20220124141035_create_appeals.rb' + - 'db/migrate/20220202200743_add_trendable_to_accounts.rb' + - 'db/migrate/20220202200926_add_trendable_to_statuses.rb' + - 'db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb' + - 'db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb' + - 'db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb' + - 'db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb' + - 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' + - 'db/migrate/20220304195405_migrate_hide_network_preference.rb' + - 'db/migrate/20220307094650_fix_featured_tags_constraints.rb' + - 'db/migrate/20220309213005_fix_reblog_deleted_at.rb' + - 'db/migrate/20220316233212_update_kurdish_locales.rb' + - 'db/migrate/20220428112511_add_index_statuses_on_account_id.rb' + - 'db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb' + - 'db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb' + - 'db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb' + - 'db/migrate/20220606044941_create_webhooks.rb' + - 'db/migrate/20220611210335_create_user_roles.rb' + - 'db/migrate/20220611212541_add_role_id_to_users.rb' + - 'db/migrate/20220710102457_add_display_name_to_tags.rb' + - 'db/migrate/20220714171049_create_tag_follows.rb' + - 'db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb' + - 'db/migrate/20220824233535_create_status_trends.rb' + - 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' + - 'db/migrate/20220829192633_add_languages_to_follows.rb' + - 'db/migrate/20220829192658_add_languages_to_follow_requests.rb' + - 'db/migrate/20221006061337_create_preview_card_trends.rb' + - 'db/migrate/20221012181003_add_blurhash_to_site_uploads.rb' + - 'db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb' + - 'db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb' + - 'db/migrate/20221104133904_add_name_to_featured_tags.rb' + - 'db/post_migrate/20190519130537_remove_boosts_widening_audience.rb' + - 'db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb' + - 'db/post_migrate/20220118183123_remove_rememberable_from_users.rb' + - 'db/seeds/01_web_app.rb' + - 'db/seeds/02_instance_actor.rb' + - 'db/seeds/03_roles.rb' + - 'db/seeds/04_admin.rb' + - 'lib/rails/engine_extensions.rb' + - 'lib/tasks/branding.rake' + - 'spec/fabricators_spec.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. +Style/GuardClause: + Exclude: + - 'app/controllers/admin/confirmations_controller.rb' + - 'app/controllers/auth/confirmations_controller.rb' + - 'app/controllers/auth/passwords_controller.rb' + - 'app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb' + - 'app/lib/activitypub/activity/block.rb' + - 'app/lib/connection_pool/shared_connection_pool.rb' + - 'app/lib/request.rb' + - 'app/lib/request_pool.rb' + - 'app/lib/webfinger.rb' + - 'app/lib/webfinger_resource.rb' + - 'app/models/concerns/account_counters.rb' + - 'app/models/concerns/ldap_authenticable.rb' + - 'app/models/tag.rb' + - 'app/models/user.rb' + - 'app/services/fan_out_on_write_service.rb' + - 'app/services/post_status_service.rb' + - 'app/services/process_hashtags_service.rb' + - 'app/workers/move_worker.rb' + - 'app/workers/redownload_avatar_worker.rb' + - 'app/workers/redownload_header_worker.rb' + - 'app/workers/redownload_media_worker.rb' + - 'app/workers/remote_account_refresh_worker.rb' + - 'db/migrate/20170901141119_truncate_preview_cards.rb' + - 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb' + - 'lib/devise/two_factor_ldap_authenticatable.rb' + - 'lib/devise/two_factor_pam_authenticatable.rb' + - 'lib/mastodon/accounts_cli.rb' + - 'lib/mastodon/maintenance_cli.rb' + - 'lib/mastodon/media_cli.rb' + - 'lib/paperclip/attachment_extensions.rb' + - 'lib/tasks/repo.rake' + # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: braces, no_braces @@ -1982,7 +3954,6 @@ Style/HashAsLastArrayItem: - 'app/services/notify_service.rb' - 'db/migrate/20181024224956_migrate_account_conversations.rb' -# Offense count: 12 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys @@ -1996,14 +3967,12 @@ Style/HashSyntax: - 'spec/controllers/admin/statuses_controller_spec.rb' - 'spec/controllers/concerns/signature_verification_spec.rb' -# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/HashTransformValues: Exclude: - 'app/serializers/rest/web_push_subscription_serializer.rb' - 'app/services/import_service.rb' -# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: InverseMethods, InverseBlocks. Style/InverseMethods: @@ -2012,13 +3981,11 @@ Style/InverseMethods: - 'app/services/update_account_service.rb' - 'spec/controllers/activitypub/replies_controller_spec.rb' -# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Style/MapToHash: Exclude: - 'app/models/status.rb' -# Offense count: 17 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: literals, strict @@ -2035,7 +4002,6 @@ Style/MutableConstant: - 'lib/mastodon/snowflake.rb' - 'spec/controllers/api/base_controller_spec.rb' -# Offense count: 10 # Configuration parameters: AllowedMethods. # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: @@ -2050,7 +4016,6 @@ Style/OptionalBooleanParameter: - 'app/workers/unfollow_follow_worker.rb' - 'lib/mastodon/redis_config.rb' -# Offense count: 16 # This cop supports safe autocorrection (--autocorrect). Style/RedundantRegexpCharacterClass: Exclude: @@ -2062,7 +4027,6 @@ Style/RedundantRegexpCharacterClass: - 'lib/tasks/emojis.rake' - 'lib/tasks/mastodon.rake' -# Offense count: 10 # This cop supports safe autocorrection (--autocorrect). Style/RedundantRegexpEscape: Exclude: @@ -2073,7 +4037,6 @@ Style/RedundantRegexpEscape: - 'lib/paperclip/color_extractor.rb' - 'lib/tasks/mastodon.rake' -# Offense count: 19 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed @@ -2095,7 +4058,6 @@ Style/RegexpLiteral: - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/tasks/mastodon.rake' -# Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. # AllowedMethods: present?, blank?, presence, try, try! @@ -2104,7 +4066,6 @@ Style/SafeNavigation: - 'app/models/concerns/account_finder_concern.rb' - 'app/models/status.rb' -# Offense count: 5 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowAsExpressionSeparator. Style/Semicolon: @@ -2113,7 +4074,6 @@ Style/Semicolon: - 'spec/validators/blacklisted_email_validator_spec.rb' - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' -# Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: only_raise, only_fail, semantic @@ -2122,19 +4082,16 @@ Style/SignalException: - 'lib/devise/two_factor_ldap_authenticatable.rb' - 'lib/devise/two_factor_pam_authenticatable.rb' -# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/SingleArgumentDig: Exclude: - 'lib/webpacker/manifest_extensions.rb' -# Offense count: 14 # This cop supports unsafe autocorrection (--autocorrect-all). Style/SlicingWithRange: Exclude: - 'app/lib/emoji_formatter.rb' - 'app/lib/text_formatter.rb' - - 'app/lib/toc_generator.rb' - 'app/models/account_alias.rb' - 'app/models/domain_block.rb' - 'app/models/email_domain_block.rb' @@ -2144,3 +4101,9 @@ Style/SlicingWithRange: - 'lib/active_record/batches.rb' - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/tasks/repo.rake' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 701 diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb index fc70c8785..b2dfe58d5 100644 --- a/lib/mastodon/media_cli.rb +++ b/lib/mastodon/media_cli.rb @@ -35,7 +35,6 @@ module Mastodon follow status. By default, only accounts that are not followed by or following anyone locally are pruned. DESC - # rubocop:disable Metrics/PerceivedComplexity def remove if options[:prune_profiles] && options[:remove_headers] say('--prune-profiles and --remove-headers should not be specified simultaneously', :red, true) @@ -224,7 +223,6 @@ module Mastodon say("Removed #{removed} orphans (approx. #{number_to_human_size(reclaimed_bytes)})#{dry_run}", :green, true) end - # rubocop:enable Metrics/PerceivedComplexity option :account, type: :string option :domain, type: :string -- cgit From edc7ca5920641e938cb50c0bf49ff6b0c77a80b4 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 16 Mar 2023 17:24:01 -0400 Subject: Roll back unintentionally activated rubocop rules (#24132) Co-authored-by: Eugen Rochko Co-authored-by: Nick Schonning --- .rubocop.yml | 10 + .rubocop_todo.yml | 1787 +---------------------------------------------------- 2 files changed, 11 insertions(+), 1786 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 8eb3d402e..4f4c98dc9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -113,6 +113,16 @@ RSpec/NotToNot: RSpec/Rails/HttpStatus: EnforcedStyle: numeric +# Reason: +# https://docs.rubocop.org/rubocop/cops_style.html#styleclassandmodulechildren +Style/ClassAndModuleChildren: + Enabled: false + +# Reason: Classes mostly self-document with their names +# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentation +Style/Documentation: + Enabled: false + Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 85f078dcf..1df2a7b10 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -150,7 +150,7 @@ Metrics/BlockNesting: # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 373 + Max: 368 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: @@ -1724,455 +1724,6 @@ Style/CaseLikeIf: Exclude: - 'app/controllers/concerns/signature_verification.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: nested, compact -Style/ClassAndModuleChildren: - Exclude: - - 'app/controllers/activitypub/base_controller.rb' - - 'app/controllers/activitypub/claims_controller.rb' - - 'app/controllers/activitypub/collections_controller.rb' - - 'app/controllers/activitypub/followers_synchronizations_controller.rb' - - 'app/controllers/activitypub/inboxes_controller.rb' - - 'app/controllers/activitypub/outboxes_controller.rb' - - 'app/controllers/activitypub/replies_controller.rb' - - 'app/controllers/admin/announcements_controller.rb' - - 'app/controllers/admin/disputes/appeals_controller.rb' - - 'app/controllers/admin/domain_allows_controller.rb' - - 'app/controllers/admin/reports/actions_controller.rb' - - 'app/controllers/admin/settings/about_controller.rb' - - 'app/controllers/admin/settings/appearance_controller.rb' - - 'app/controllers/admin/settings/branding_controller.rb' - - 'app/controllers/admin/settings/content_retention_controller.rb' - - 'app/controllers/admin/settings/discovery_controller.rb' - - 'app/controllers/admin/settings/registrations_controller.rb' - - 'app/controllers/admin/trends/links/preview_card_providers_controller.rb' - - 'app/controllers/admin/trends/links_controller.rb' - - 'app/controllers/admin/trends/statuses_controller.rb' - - 'app/controllers/admin/trends/tags_controller.rb' - - 'app/controllers/admin/users/roles_controller.rb' - - 'app/controllers/admin/users/two_factor_authentications_controller.rb' - - 'app/controllers/admin/webhooks/secrets_controller.rb' - - 'app/controllers/api/base_controller.rb' - - 'app/controllers/api/oembed_controller.rb' - - 'app/controllers/api/v1/accounts/credentials_controller.rb' - - 'app/controllers/api/v1/accounts/familiar_followers_controller.rb' - - 'app/controllers/api/v1/accounts/featured_tags_controller.rb' - - 'app/controllers/api/v1/accounts/follower_accounts_controller.rb' - - 'app/controllers/api/v1/accounts/following_accounts_controller.rb' - - 'app/controllers/api/v1/accounts/identity_proofs_controller.rb' - - 'app/controllers/api/v1/accounts/lists_controller.rb' - - 'app/controllers/api/v1/accounts/lookup_controller.rb' - - 'app/controllers/api/v1/accounts/notes_controller.rb' - - 'app/controllers/api/v1/accounts/pins_controller.rb' - - 'app/controllers/api/v1/accounts/relationships_controller.rb' - - 'app/controllers/api/v1/accounts/search_controller.rb' - - 'app/controllers/api/v1/accounts/statuses_controller.rb' - - 'app/controllers/api/v1/accounts_controller.rb' - - 'app/controllers/api/v1/admin/account_actions_controller.rb' - - 'app/controllers/api/v1/admin/accounts_controller.rb' - - 'app/controllers/api/v1/admin/canonical_email_blocks_controller.rb' - - 'app/controllers/api/v1/admin/dimensions_controller.rb' - - 'app/controllers/api/v1/admin/domain_allows_controller.rb' - - 'app/controllers/api/v1/admin/domain_blocks_controller.rb' - - 'app/controllers/api/v1/admin/email_domain_blocks_controller.rb' - - 'app/controllers/api/v1/admin/ip_blocks_controller.rb' - - 'app/controllers/api/v1/admin/measures_controller.rb' - - 'app/controllers/api/v1/admin/reports_controller.rb' - - 'app/controllers/api/v1/admin/retention_controller.rb' - - 'app/controllers/api/v1/admin/trends/links_controller.rb' - - 'app/controllers/api/v1/admin/trends/statuses_controller.rb' - - 'app/controllers/api/v1/admin/trends/tags_controller.rb' - - 'app/controllers/api/v1/announcements/reactions_controller.rb' - - 'app/controllers/api/v1/announcements_controller.rb' - - 'app/controllers/api/v1/apps/credentials_controller.rb' - - 'app/controllers/api/v1/apps_controller.rb' - - 'app/controllers/api/v1/blocks_controller.rb' - - 'app/controllers/api/v1/bookmarks_controller.rb' - - 'app/controllers/api/v1/conversations_controller.rb' - - 'app/controllers/api/v1/crypto/deliveries_controller.rb' - - 'app/controllers/api/v1/crypto/encrypted_messages_controller.rb' - - 'app/controllers/api/v1/crypto/keys/claims_controller.rb' - - 'app/controllers/api/v1/crypto/keys/counts_controller.rb' - - 'app/controllers/api/v1/crypto/keys/queries_controller.rb' - - 'app/controllers/api/v1/crypto/keys/uploads_controller.rb' - - 'app/controllers/api/v1/custom_emojis_controller.rb' - - 'app/controllers/api/v1/directories_controller.rb' - - 'app/controllers/api/v1/domain_blocks_controller.rb' - - 'app/controllers/api/v1/emails/confirmations_controller.rb' - - 'app/controllers/api/v1/endorsements_controller.rb' - - 'app/controllers/api/v1/favourites_controller.rb' - - 'app/controllers/api/v1/featured_tags/suggestions_controller.rb' - - 'app/controllers/api/v1/featured_tags_controller.rb' - - 'app/controllers/api/v1/filters_controller.rb' - - 'app/controllers/api/v1/follow_requests_controller.rb' - - 'app/controllers/api/v1/followed_tags_controller.rb' - - 'app/controllers/api/v1/instances/activity_controller.rb' - - 'app/controllers/api/v1/instances/domain_blocks_controller.rb' - - 'app/controllers/api/v1/instances/extended_descriptions_controller.rb' - - 'app/controllers/api/v1/instances/peers_controller.rb' - - 'app/controllers/api/v1/instances/privacy_policies_controller.rb' - - 'app/controllers/api/v1/instances/rules_controller.rb' - - 'app/controllers/api/v1/instances_controller.rb' - - 'app/controllers/api/v1/lists/accounts_controller.rb' - - 'app/controllers/api/v1/lists_controller.rb' - - 'app/controllers/api/v1/markers_controller.rb' - - 'app/controllers/api/v1/media_controller.rb' - - 'app/controllers/api/v1/mutes_controller.rb' - - 'app/controllers/api/v1/notifications_controller.rb' - - 'app/controllers/api/v1/polls/votes_controller.rb' - - 'app/controllers/api/v1/polls_controller.rb' - - 'app/controllers/api/v1/preferences_controller.rb' - - 'app/controllers/api/v1/push/subscriptions_controller.rb' - - 'app/controllers/api/v1/reports_controller.rb' - - 'app/controllers/api/v1/scheduled_statuses_controller.rb' - - 'app/controllers/api/v1/statuses/bookmarks_controller.rb' - - 'app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb' - - 'app/controllers/api/v1/statuses/favourites_controller.rb' - - 'app/controllers/api/v1/statuses/histories_controller.rb' - - 'app/controllers/api/v1/statuses/mutes_controller.rb' - - 'app/controllers/api/v1/statuses/pins_controller.rb' - - 'app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb' - - 'app/controllers/api/v1/statuses/reblogs_controller.rb' - - 'app/controllers/api/v1/statuses/sources_controller.rb' - - 'app/controllers/api/v1/statuses/translations_controller.rb' - - 'app/controllers/api/v1/statuses_controller.rb' - - 'app/controllers/api/v1/streaming_controller.rb' - - 'app/controllers/api/v1/suggestions_controller.rb' - - 'app/controllers/api/v1/tags_controller.rb' - - 'app/controllers/api/v1/timelines/home_controller.rb' - - 'app/controllers/api/v1/timelines/list_controller.rb' - - 'app/controllers/api/v1/timelines/public_controller.rb' - - 'app/controllers/api/v1/timelines/tag_controller.rb' - - 'app/controllers/api/v1/trends/links_controller.rb' - - 'app/controllers/api/v1/trends/statuses_controller.rb' - - 'app/controllers/api/v1/trends/tags_controller.rb' - - 'app/controllers/api/v2/admin/accounts_controller.rb' - - 'app/controllers/api/v2/filters/keywords_controller.rb' - - 'app/controllers/api/v2/filters/statuses_controller.rb' - - 'app/controllers/api/v2/filters_controller.rb' - - 'app/controllers/api/v2/instances_controller.rb' - - 'app/controllers/api/v2/media_controller.rb' - - 'app/controllers/api/v2/search_controller.rb' - - 'app/controllers/api/v2/suggestions_controller.rb' - - 'app/controllers/api/web/base_controller.rb' - - 'app/controllers/api/web/embeds_controller.rb' - - 'app/controllers/api/web/push_subscriptions_controller.rb' - - 'app/controllers/api/web/settings_controller.rb' - - 'app/controllers/auth/challenges_controller.rb' - - 'app/controllers/auth/confirmations_controller.rb' - - 'app/controllers/auth/omniauth_callbacks_controller.rb' - - 'app/controllers/auth/passwords_controller.rb' - - 'app/controllers/auth/registrations_controller.rb' - - 'app/controllers/auth/sessions_controller.rb' - - 'app/controllers/auth/setup_controller.rb' - - 'app/controllers/disputes/appeals_controller.rb' - - 'app/controllers/disputes/base_controller.rb' - - 'app/controllers/disputes/strikes_controller.rb' - - 'app/controllers/filters/statuses_controller.rb' - - 'app/controllers/oauth/authorizations_controller.rb' - - 'app/controllers/oauth/authorized_applications_controller.rb' - - 'app/controllers/oauth/tokens_controller.rb' - - 'app/controllers/settings/aliases_controller.rb' - - 'app/controllers/settings/applications_controller.rb' - - 'app/controllers/settings/base_controller.rb' - - 'app/controllers/settings/deletes_controller.rb' - - 'app/controllers/settings/exports_controller.rb' - - 'app/controllers/settings/featured_tags_controller.rb' - - 'app/controllers/settings/imports_controller.rb' - - 'app/controllers/settings/login_activities_controller.rb' - - 'app/controllers/settings/migration/redirects_controller.rb' - - 'app/controllers/settings/migrations_controller.rb' - - 'app/controllers/settings/preferences/appearance_controller.rb' - - 'app/controllers/settings/preferences/notifications_controller.rb' - - 'app/controllers/settings/preferences/other_controller.rb' - - 'app/controllers/settings/preferences_controller.rb' - - 'app/controllers/settings/profiles_controller.rb' - - 'app/controllers/settings/sessions_controller.rb' - - 'app/helpers/admin/account_moderation_notes_helper.rb' - - 'app/helpers/admin/action_logs_helper.rb' - - 'app/helpers/admin/dashboard_helper.rb' - - 'app/helpers/admin/filter_helper.rb' - - 'app/helpers/admin/settings_helper.rb' - - 'app/helpers/admin/trends/statuses_helper.rb' - - 'app/lib/activitypub/activity.rb' - - 'app/lib/activitypub/activity/accept.rb' - - 'app/lib/activitypub/activity/add.rb' - - 'app/lib/activitypub/activity/announce.rb' - - 'app/lib/activitypub/activity/block.rb' - - 'app/lib/activitypub/activity/create.rb' - - 'app/lib/activitypub/activity/delete.rb' - - 'app/lib/activitypub/activity/flag.rb' - - 'app/lib/activitypub/activity/follow.rb' - - 'app/lib/activitypub/activity/like.rb' - - 'app/lib/activitypub/activity/move.rb' - - 'app/lib/activitypub/activity/reject.rb' - - 'app/lib/activitypub/activity/remove.rb' - - 'app/lib/activitypub/activity/undo.rb' - - 'app/lib/activitypub/activity/update.rb' - - 'app/lib/activitypub/adapter.rb' - - 'app/lib/activitypub/case_transform.rb' - - 'app/lib/activitypub/dereferencer.rb' - - 'app/lib/activitypub/forwarder.rb' - - 'app/lib/activitypub/linked_data_signature.rb' - - 'app/lib/activitypub/parser/custom_emoji_parser.rb' - - 'app/lib/activitypub/parser/media_attachment_parser.rb' - - 'app/lib/activitypub/parser/poll_parser.rb' - - 'app/lib/activitypub/parser/status_parser.rb' - - 'app/lib/activitypub/serializer.rb' - - 'app/lib/activitypub/tag_manager.rb' - - 'app/lib/admin/metrics/dimension.rb' - - 'app/lib/admin/metrics/dimension/base_dimension.rb' - - 'app/lib/admin/metrics/dimension/instance_accounts_dimension.rb' - - 'app/lib/admin/metrics/dimension/instance_languages_dimension.rb' - - 'app/lib/admin/metrics/dimension/languages_dimension.rb' - - 'app/lib/admin/metrics/dimension/servers_dimension.rb' - - 'app/lib/admin/metrics/dimension/software_versions_dimension.rb' - - 'app/lib/admin/metrics/dimension/sources_dimension.rb' - - 'app/lib/admin/metrics/dimension/space_usage_dimension.rb' - - 'app/lib/admin/metrics/dimension/tag_languages_dimension.rb' - - 'app/lib/admin/metrics/dimension/tag_servers_dimension.rb' - - 'app/lib/admin/metrics/measure.rb' - - 'app/lib/admin/metrics/measure/active_users_measure.rb' - - 'app/lib/admin/metrics/measure/base_measure.rb' - - 'app/lib/admin/metrics/measure/instance_accounts_measure.rb' - - 'app/lib/admin/metrics/measure/instance_followers_measure.rb' - - 'app/lib/admin/metrics/measure/instance_follows_measure.rb' - - 'app/lib/admin/metrics/measure/instance_media_attachments_measure.rb' - - 'app/lib/admin/metrics/measure/instance_reports_measure.rb' - - 'app/lib/admin/metrics/measure/instance_statuses_measure.rb' - - 'app/lib/admin/metrics/measure/interactions_measure.rb' - - 'app/lib/admin/metrics/measure/new_users_measure.rb' - - 'app/lib/admin/metrics/measure/opened_reports_measure.rb' - - 'app/lib/admin/metrics/measure/resolved_reports_measure.rb' - - 'app/lib/admin/metrics/measure/tag_accounts_measure.rb' - - 'app/lib/admin/metrics/measure/tag_servers_measure.rb' - - 'app/lib/admin/metrics/measure/tag_uses_measure.rb' - - 'app/lib/admin/metrics/retention.rb' - - 'app/lib/admin/system_check.rb' - - 'app/lib/admin/system_check/base_check.rb' - - 'app/lib/admin/system_check/database_schema_check.rb' - - 'app/lib/admin/system_check/elasticsearch_check.rb' - - 'app/lib/admin/system_check/message.rb' - - 'app/lib/admin/system_check/rules_check.rb' - - 'app/lib/admin/system_check/sidekiq_process_check.rb' - - 'app/lib/connection_pool/shared_connection_pool.rb' - - 'app/lib/connection_pool/shared_timed_stack.rb' - - 'app/lib/importer/accounts_index_importer.rb' - - 'app/lib/importer/base_importer.rb' - - 'app/lib/importer/statuses_index_importer.rb' - - 'app/lib/importer/tags_index_importer.rb' - - 'app/lib/nodeinfo/adapter.rb' - - 'app/lib/ostatus/tag_manager.rb' - - 'app/lib/request.rb' - - 'app/lib/rss/builder.rb' - - 'app/lib/rss/channel.rb' - - 'app/lib/rss/element.rb' - - 'app/lib/rss/item.rb' - - 'app/lib/rss/media_content.rb' - - 'app/lib/translation_service/deepl.rb' - - 'app/lib/translation_service/libre_translate.rb' - - 'app/lib/translation_service/translation.rb' - - 'app/lib/vacuum/access_tokens_vacuum.rb' - - 'app/lib/vacuum/backups_vacuum.rb' - - 'app/lib/vacuum/feeds_vacuum.rb' - - 'app/lib/vacuum/media_attachments_vacuum.rb' - - 'app/lib/vacuum/preview_cards_vacuum.rb' - - 'app/lib/vacuum/statuses_vacuum.rb' - - 'app/lib/vacuum/system_keys_vacuum.rb' - - 'app/models/account/field.rb' - - 'app/models/account_suggestions/global_source.rb' - - 'app/models/account_suggestions/past_interactions_source.rb' - - 'app/models/account_suggestions/setting_source.rb' - - 'app/models/account_suggestions/source.rb' - - 'app/models/account_suggestions/suggestion.rb' - - 'app/models/admin/account_action.rb' - - 'app/models/admin/action_log.rb' - - 'app/models/admin/action_log_filter.rb' - - 'app/models/admin/appeal_filter.rb' - - 'app/models/admin/import.rb' - - 'app/models/admin/status_batch_action.rb' - - 'app/models/admin/status_filter.rb' - - 'app/models/form/account_batch.rb' - - 'app/models/form/admin_settings.rb' - - 'app/models/form/challenge.rb' - - 'app/models/form/custom_emoji_batch.rb' - - 'app/models/form/delete_confirmation.rb' - - 'app/models/form/domain_block_batch.rb' - - 'app/models/form/email_domain_block_batch.rb' - - 'app/models/form/ip_block_batch.rb' - - 'app/models/form/redirect.rb' - - 'app/models/form/status_filter_batch_action.rb' - - 'app/models/form/two_factor_confirmation.rb' - - 'app/models/trends/base.rb' - - 'app/models/trends/history.rb' - - 'app/models/trends/links.rb' - - 'app/models/trends/preview_card_batch.rb' - - 'app/models/trends/preview_card_filter.rb' - - 'app/models/trends/preview_card_provider_batch.rb' - - 'app/models/trends/preview_card_provider_filter.rb' - - 'app/models/trends/query.rb' - - 'app/models/trends/status_batch.rb' - - 'app/models/trends/status_filter.rb' - - 'app/models/trends/statuses.rb' - - 'app/models/trends/tag_batch.rb' - - 'app/models/trends/tag_filter.rb' - - 'app/models/trends/tags.rb' - - 'app/models/web/push_subscription.rb' - - 'app/models/web/setting.rb' - - 'app/policies/admin/status_policy.rb' - - 'app/presenters/activitypub/activity_presenter.rb' - - 'app/presenters/activitypub/collection_presenter.rb' - - 'app/presenters/webhooks/event_presenter.rb' - - 'app/serializers/activitypub/accept_follow_serializer.rb' - - 'app/serializers/activitypub/activity_serializer.rb' - - 'app/serializers/activitypub/actor_serializer.rb' - - 'app/serializers/activitypub/add_serializer.rb' - - 'app/serializers/activitypub/block_serializer.rb' - - 'app/serializers/activitypub/collection_serializer.rb' - - 'app/serializers/activitypub/delete_actor_serializer.rb' - - 'app/serializers/activitypub/delete_serializer.rb' - - 'app/serializers/activitypub/device_serializer.rb' - - 'app/serializers/activitypub/emoji_serializer.rb' - - 'app/serializers/activitypub/encrypted_message_serializer.rb' - - 'app/serializers/activitypub/flag_serializer.rb' - - 'app/serializers/activitypub/follow_serializer.rb' - - 'app/serializers/activitypub/hashtag_serializer.rb' - - 'app/serializers/activitypub/image_serializer.rb' - - 'app/serializers/activitypub/like_serializer.rb' - - 'app/serializers/activitypub/move_serializer.rb' - - 'app/serializers/activitypub/note_serializer.rb' - - 'app/serializers/activitypub/one_time_key_serializer.rb' - - 'app/serializers/activitypub/outbox_serializer.rb' - - 'app/serializers/activitypub/public_key_serializer.rb' - - 'app/serializers/activitypub/reject_follow_serializer.rb' - - 'app/serializers/activitypub/remove_serializer.rb' - - 'app/serializers/activitypub/undo_announce_serializer.rb' - - 'app/serializers/activitypub/undo_block_serializer.rb' - - 'app/serializers/activitypub/undo_follow_serializer.rb' - - 'app/serializers/activitypub/undo_like_serializer.rb' - - 'app/serializers/activitypub/update_poll_serializer.rb' - - 'app/serializers/activitypub/update_serializer.rb' - - 'app/serializers/activitypub/vote_serializer.rb' - - 'app/serializers/nodeinfo/discovery_serializer.rb' - - 'app/serializers/nodeinfo/serializer.rb' - - 'app/serializers/rest/account_serializer.rb' - - 'app/serializers/rest/admin/account_serializer.rb' - - 'app/serializers/rest/admin/canonical_email_block_serializer.rb' - - 'app/serializers/rest/admin/cohort_serializer.rb' - - 'app/serializers/rest/admin/dimension_serializer.rb' - - 'app/serializers/rest/admin/domain_allow_serializer.rb' - - 'app/serializers/rest/admin/domain_block_serializer.rb' - - 'app/serializers/rest/admin/email_domain_block_serializer.rb' - - 'app/serializers/rest/admin/existing_domain_block_error_serializer.rb' - - 'app/serializers/rest/admin/ip_block_serializer.rb' - - 'app/serializers/rest/admin/ip_serializer.rb' - - 'app/serializers/rest/admin/measure_serializer.rb' - - 'app/serializers/rest/admin/report_serializer.rb' - - 'app/serializers/rest/admin/tag_serializer.rb' - - 'app/serializers/rest/admin/webhook_event_serializer.rb' - - 'app/serializers/rest/announcement_serializer.rb' - - 'app/serializers/rest/application_serializer.rb' - - 'app/serializers/rest/context_serializer.rb' - - 'app/serializers/rest/conversation_serializer.rb' - - 'app/serializers/rest/credential_account_serializer.rb' - - 'app/serializers/rest/custom_emoji_serializer.rb' - - 'app/serializers/rest/domain_block_serializer.rb' - - 'app/serializers/rest/encrypted_message_serializer.rb' - - 'app/serializers/rest/extended_description_serializer.rb' - - 'app/serializers/rest/familiar_followers_serializer.rb' - - 'app/serializers/rest/featured_tag_serializer.rb' - - 'app/serializers/rest/filter_keyword_serializer.rb' - - 'app/serializers/rest/filter_result_serializer.rb' - - 'app/serializers/rest/filter_serializer.rb' - - 'app/serializers/rest/filter_status_serializer.rb' - - 'app/serializers/rest/instance_serializer.rb' - - 'app/serializers/rest/keys/claim_result_serializer.rb' - - 'app/serializers/rest/keys/device_serializer.rb' - - 'app/serializers/rest/keys/query_result_serializer.rb' - - 'app/serializers/rest/list_serializer.rb' - - 'app/serializers/rest/marker_serializer.rb' - - 'app/serializers/rest/media_attachment_serializer.rb' - - 'app/serializers/rest/muted_account_serializer.rb' - - 'app/serializers/rest/notification_serializer.rb' - - 'app/serializers/rest/poll_serializer.rb' - - 'app/serializers/rest/preferences_serializer.rb' - - 'app/serializers/rest/preview_card_serializer.rb' - - 'app/serializers/rest/privacy_policy_serializer.rb' - - 'app/serializers/rest/reaction_serializer.rb' - - 'app/serializers/rest/relationship_serializer.rb' - - 'app/serializers/rest/report_serializer.rb' - - 'app/serializers/rest/role_serializer.rb' - - 'app/serializers/rest/rule_serializer.rb' - - 'app/serializers/rest/scheduled_status_serializer.rb' - - 'app/serializers/rest/search_serializer.rb' - - 'app/serializers/rest/status_edit_serializer.rb' - - 'app/serializers/rest/status_serializer.rb' - - 'app/serializers/rest/status_source_serializer.rb' - - 'app/serializers/rest/suggestion_serializer.rb' - - 'app/serializers/rest/tag_serializer.rb' - - 'app/serializers/rest/translation_serializer.rb' - - 'app/serializers/rest/trends/link_serializer.rb' - - 'app/serializers/rest/v1/filter_serializer.rb' - - 'app/serializers/rest/v1/instance_serializer.rb' - - 'app/serializers/rest/web_push_subscription_serializer.rb' - - 'app/serializers/web/notification_serializer.rb' - - 'app/services/activitypub/fetch_featured_collection_service.rb' - - 'app/services/activitypub/fetch_featured_tags_collection_service.rb' - - 'app/services/activitypub/fetch_remote_account_service.rb' - - 'app/services/activitypub/fetch_remote_actor_service.rb' - - 'app/services/activitypub/fetch_remote_key_service.rb' - - 'app/services/activitypub/fetch_remote_poll_service.rb' - - 'app/services/activitypub/fetch_remote_status_service.rb' - - 'app/services/activitypub/fetch_replies_service.rb' - - 'app/services/activitypub/prepare_followers_synchronization_service.rb' - - 'app/services/activitypub/process_account_service.rb' - - 'app/services/activitypub/process_collection_service.rb' - - 'app/services/activitypub/process_status_update_service.rb' - - 'app/services/activitypub/synchronize_followers_service.rb' - - 'app/services/keys/claim_service.rb' - - 'app/services/keys/query_service.rb' - - 'app/workers/activitypub/account_raw_distribution_worker.rb' - - 'app/workers/activitypub/delivery_worker.rb' - - 'app/workers/activitypub/distribute_poll_update_worker.rb' - - 'app/workers/activitypub/distribution_worker.rb' - - 'app/workers/activitypub/fetch_replies_worker.rb' - - 'app/workers/activitypub/followers_synchronization_worker.rb' - - 'app/workers/activitypub/low_priority_delivery_worker.rb' - - 'app/workers/activitypub/migrated_follow_delivery_worker.rb' - - 'app/workers/activitypub/move_distribution_worker.rb' - - 'app/workers/activitypub/post_upgrade_worker.rb' - - 'app/workers/activitypub/processing_worker.rb' - - 'app/workers/activitypub/raw_distribution_worker.rb' - - 'app/workers/activitypub/status_update_distribution_worker.rb' - - 'app/workers/activitypub/synchronize_featured_collection_worker.rb' - - 'app/workers/activitypub/synchronize_featured_tags_collection_worker.rb' - - 'app/workers/activitypub/update_distribution_worker.rb' - - 'app/workers/admin/account_deletion_worker.rb' - - 'app/workers/admin/domain_purge_worker.rb' - - 'app/workers/admin/suspension_worker.rb' - - 'app/workers/admin/unsuspension_worker.rb' - - 'app/workers/import/relationship_worker.rb' - - 'app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb' - - 'app/workers/scheduler/follow_recommendations_scheduler.rb' - - 'app/workers/scheduler/indexing_scheduler.rb' - - 'app/workers/scheduler/instance_refresh_scheduler.rb' - - 'app/workers/scheduler/ip_cleanup_scheduler.rb' - - 'app/workers/scheduler/pghero_scheduler.rb' - - 'app/workers/scheduler/scheduled_statuses_scheduler.rb' - - 'app/workers/scheduler/suspended_user_cleanup_scheduler.rb' - - 'app/workers/scheduler/trends/refresh_scheduler.rb' - - 'app/workers/scheduler/trends/review_notifications_scheduler.rb' - - 'app/workers/scheduler/user_cleanup_scheduler.rb' - - 'app/workers/scheduler/vacuum_scheduler.rb' - - 'app/workers/web/push_notification_worker.rb' - - 'app/workers/webhooks/delivery_worker.rb' - - 'lib/mastodon/rack_middleware.rb' - - 'lib/mastodon/sidekiq_middleware.rb' - - 'lib/mastodon/snowflake.rb' - - 'lib/webpacker/helper_extensions.rb' - - 'lib/webpacker/manifest_extensions.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedMethods, AllowedPatterns. # AllowedMethods: ==, equal?, eql? @@ -2191,1342 +1742,6 @@ Style/ConcatArrayLiterals: Exclude: - 'app/lib/feed_manager.rb' -# Configuration parameters: AllowedConstants. -Style/Documentation: - Exclude: - - 'app/chewy/accounts_index.rb' - - 'app/chewy/statuses_index.rb' - - 'app/chewy/tags_index.rb' - - 'app/controllers/about_controller.rb' - - 'app/controllers/accounts_controller.rb' - - 'app/controllers/activitypub/base_controller.rb' - - 'app/controllers/activitypub/claims_controller.rb' - - 'app/controllers/activitypub/collections_controller.rb' - - 'app/controllers/activitypub/followers_synchronizations_controller.rb' - - 'app/controllers/activitypub/inboxes_controller.rb' - - 'app/controllers/activitypub/outboxes_controller.rb' - - 'app/controllers/activitypub/replies_controller.rb' - - 'app/controllers/admin/account_actions_controller.rb' - - 'app/controllers/admin/account_moderation_notes_controller.rb' - - 'app/controllers/admin/accounts_controller.rb' - - 'app/controllers/admin/action_logs_controller.rb' - - 'app/controllers/admin/announcements_controller.rb' - - 'app/controllers/admin/base_controller.rb' - - 'app/controllers/admin/change_emails_controller.rb' - - 'app/controllers/admin/confirmations_controller.rb' - - 'app/controllers/admin/custom_emojis_controller.rb' - - 'app/controllers/admin/dashboard_controller.rb' - - 'app/controllers/admin/disputes/appeals_controller.rb' - - 'app/controllers/admin/domain_allows_controller.rb' - - 'app/controllers/admin/domain_blocks_controller.rb' - - 'app/controllers/admin/email_domain_blocks_controller.rb' - - 'app/controllers/admin/export_domain_allows_controller.rb' - - 'app/controllers/admin/export_domain_blocks_controller.rb' - - 'app/controllers/admin/follow_recommendations_controller.rb' - - 'app/controllers/admin/instances_controller.rb' - - 'app/controllers/admin/invites_controller.rb' - - 'app/controllers/admin/ip_blocks_controller.rb' - - 'app/controllers/admin/relationships_controller.rb' - - 'app/controllers/admin/relays_controller.rb' - - 'app/controllers/admin/report_notes_controller.rb' - - 'app/controllers/admin/reports/actions_controller.rb' - - 'app/controllers/admin/reports_controller.rb' - - 'app/controllers/admin/resets_controller.rb' - - 'app/controllers/admin/roles_controller.rb' - - 'app/controllers/admin/rules_controller.rb' - - 'app/controllers/admin/settings/about_controller.rb' - - 'app/controllers/admin/settings/appearance_controller.rb' - - 'app/controllers/admin/settings/branding_controller.rb' - - 'app/controllers/admin/settings/content_retention_controller.rb' - - 'app/controllers/admin/settings/discovery_controller.rb' - - 'app/controllers/admin/settings/registrations_controller.rb' - - 'app/controllers/admin/settings_controller.rb' - - 'app/controllers/admin/site_uploads_controller.rb' - - 'app/controllers/admin/statuses_controller.rb' - - 'app/controllers/admin/tags_controller.rb' - - 'app/controllers/admin/trends/links/preview_card_providers_controller.rb' - - 'app/controllers/admin/trends/links_controller.rb' - - 'app/controllers/admin/trends/statuses_controller.rb' - - 'app/controllers/admin/trends/tags_controller.rb' - - 'app/controllers/admin/users/roles_controller.rb' - - 'app/controllers/admin/users/two_factor_authentications_controller.rb' - - 'app/controllers/admin/warning_presets_controller.rb' - - 'app/controllers/admin/webhooks/secrets_controller.rb' - - 'app/controllers/admin/webhooks_controller.rb' - - 'app/controllers/api/base_controller.rb' - - 'app/controllers/api/oembed_controller.rb' - - 'app/controllers/api/v1/accounts/credentials_controller.rb' - - 'app/controllers/api/v1/accounts/familiar_followers_controller.rb' - - 'app/controllers/api/v1/accounts/featured_tags_controller.rb' - - 'app/controllers/api/v1/accounts/follower_accounts_controller.rb' - - 'app/controllers/api/v1/accounts/following_accounts_controller.rb' - - 'app/controllers/api/v1/accounts/identity_proofs_controller.rb' - - 'app/controllers/api/v1/accounts/lists_controller.rb' - - 'app/controllers/api/v1/accounts/lookup_controller.rb' - - 'app/controllers/api/v1/accounts/notes_controller.rb' - - 'app/controllers/api/v1/accounts/pins_controller.rb' - - 'app/controllers/api/v1/accounts/relationships_controller.rb' - - 'app/controllers/api/v1/accounts/search_controller.rb' - - 'app/controllers/api/v1/accounts/statuses_controller.rb' - - 'app/controllers/api/v1/accounts_controller.rb' - - 'app/controllers/api/v1/admin/account_actions_controller.rb' - - 'app/controllers/api/v1/admin/accounts_controller.rb' - - 'app/controllers/api/v1/admin/canonical_email_blocks_controller.rb' - - 'app/controllers/api/v1/admin/dimensions_controller.rb' - - 'app/controllers/api/v1/admin/domain_allows_controller.rb' - - 'app/controllers/api/v1/admin/domain_blocks_controller.rb' - - 'app/controllers/api/v1/admin/email_domain_blocks_controller.rb' - - 'app/controllers/api/v1/admin/ip_blocks_controller.rb' - - 'app/controllers/api/v1/admin/measures_controller.rb' - - 'app/controllers/api/v1/admin/reports_controller.rb' - - 'app/controllers/api/v1/admin/retention_controller.rb' - - 'app/controllers/api/v1/admin/trends/links_controller.rb' - - 'app/controllers/api/v1/admin/trends/statuses_controller.rb' - - 'app/controllers/api/v1/admin/trends/tags_controller.rb' - - 'app/controllers/api/v1/announcements/reactions_controller.rb' - - 'app/controllers/api/v1/announcements_controller.rb' - - 'app/controllers/api/v1/apps/credentials_controller.rb' - - 'app/controllers/api/v1/apps_controller.rb' - - 'app/controllers/api/v1/blocks_controller.rb' - - 'app/controllers/api/v1/bookmarks_controller.rb' - - 'app/controllers/api/v1/conversations_controller.rb' - - 'app/controllers/api/v1/crypto/deliveries_controller.rb' - - 'app/controllers/api/v1/crypto/encrypted_messages_controller.rb' - - 'app/controllers/api/v1/crypto/keys/claims_controller.rb' - - 'app/controllers/api/v1/crypto/keys/counts_controller.rb' - - 'app/controllers/api/v1/crypto/keys/queries_controller.rb' - - 'app/controllers/api/v1/crypto/keys/uploads_controller.rb' - - 'app/controllers/api/v1/custom_emojis_controller.rb' - - 'app/controllers/api/v1/directories_controller.rb' - - 'app/controllers/api/v1/domain_blocks_controller.rb' - - 'app/controllers/api/v1/emails/confirmations_controller.rb' - - 'app/controllers/api/v1/endorsements_controller.rb' - - 'app/controllers/api/v1/favourites_controller.rb' - - 'app/controllers/api/v1/featured_tags/suggestions_controller.rb' - - 'app/controllers/api/v1/featured_tags_controller.rb' - - 'app/controllers/api/v1/filters_controller.rb' - - 'app/controllers/api/v1/follow_requests_controller.rb' - - 'app/controllers/api/v1/followed_tags_controller.rb' - - 'app/controllers/api/v1/instances/activity_controller.rb' - - 'app/controllers/api/v1/instances/domain_blocks_controller.rb' - - 'app/controllers/api/v1/instances/extended_descriptions_controller.rb' - - 'app/controllers/api/v1/instances/peers_controller.rb' - - 'app/controllers/api/v1/instances/privacy_policies_controller.rb' - - 'app/controllers/api/v1/instances/rules_controller.rb' - - 'app/controllers/api/v1/instances_controller.rb' - - 'app/controllers/api/v1/lists/accounts_controller.rb' - - 'app/controllers/api/v1/lists_controller.rb' - - 'app/controllers/api/v1/markers_controller.rb' - - 'app/controllers/api/v1/media_controller.rb' - - 'app/controllers/api/v1/mutes_controller.rb' - - 'app/controllers/api/v1/notifications_controller.rb' - - 'app/controllers/api/v1/polls/votes_controller.rb' - - 'app/controllers/api/v1/polls_controller.rb' - - 'app/controllers/api/v1/preferences_controller.rb' - - 'app/controllers/api/v1/push/subscriptions_controller.rb' - - 'app/controllers/api/v1/reports_controller.rb' - - 'app/controllers/api/v1/scheduled_statuses_controller.rb' - - 'app/controllers/api/v1/statuses/bookmarks_controller.rb' - - 'app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb' - - 'app/controllers/api/v1/statuses/favourites_controller.rb' - - 'app/controllers/api/v1/statuses/histories_controller.rb' - - 'app/controllers/api/v1/statuses/mutes_controller.rb' - - 'app/controllers/api/v1/statuses/pins_controller.rb' - - 'app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb' - - 'app/controllers/api/v1/statuses/reblogs_controller.rb' - - 'app/controllers/api/v1/statuses/sources_controller.rb' - - 'app/controllers/api/v1/statuses/translations_controller.rb' - - 'app/controllers/api/v1/statuses_controller.rb' - - 'app/controllers/api/v1/streaming_controller.rb' - - 'app/controllers/api/v1/suggestions_controller.rb' - - 'app/controllers/api/v1/tags_controller.rb' - - 'app/controllers/api/v1/timelines/home_controller.rb' - - 'app/controllers/api/v1/timelines/list_controller.rb' - - 'app/controllers/api/v1/timelines/public_controller.rb' - - 'app/controllers/api/v1/timelines/tag_controller.rb' - - 'app/controllers/api/v1/trends/links_controller.rb' - - 'app/controllers/api/v1/trends/statuses_controller.rb' - - 'app/controllers/api/v1/trends/tags_controller.rb' - - 'app/controllers/api/v2/admin/accounts_controller.rb' - - 'app/controllers/api/v2/filters/keywords_controller.rb' - - 'app/controllers/api/v2/filters/statuses_controller.rb' - - 'app/controllers/api/v2/filters_controller.rb' - - 'app/controllers/api/v2/instances_controller.rb' - - 'app/controllers/api/v2/media_controller.rb' - - 'app/controllers/api/v2/search_controller.rb' - - 'app/controllers/api/v2/suggestions_controller.rb' - - 'app/controllers/api/web/base_controller.rb' - - 'app/controllers/api/web/embeds_controller.rb' - - 'app/controllers/api/web/push_subscriptions_controller.rb' - - 'app/controllers/api/web/settings_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/auth/challenges_controller.rb' - - 'app/controllers/auth/confirmations_controller.rb' - - 'app/controllers/auth/omniauth_callbacks_controller.rb' - - 'app/controllers/auth/passwords_controller.rb' - - 'app/controllers/auth/registrations_controller.rb' - - 'app/controllers/auth/sessions_controller.rb' - - 'app/controllers/auth/setup_controller.rb' - - 'app/controllers/authorize_interactions_controller.rb' - - 'app/controllers/concerns/access_token_tracking_concern.rb' - - 'app/controllers/concerns/account_controller_concern.rb' - - 'app/controllers/concerns/account_owned_concern.rb' - - 'app/controllers/concerns/accountable_concern.rb' - - 'app/controllers/concerns/admin_export_controller_concern.rb' - - 'app/controllers/concerns/authorization.rb' - - 'app/controllers/concerns/cache_concern.rb' - - 'app/controllers/concerns/export_controller_concern.rb' - - 'app/controllers/concerns/localized.rb' - - 'app/controllers/concerns/rate_limit_headers.rb' - - 'app/controllers/concerns/registration_spam_concern.rb' - - 'app/controllers/concerns/session_tracking_concern.rb' - - 'app/controllers/concerns/signature_authentication.rb' - - 'app/controllers/concerns/signature_verification.rb' - - 'app/controllers/concerns/two_factor_authentication_concern.rb' - - 'app/controllers/concerns/user_tracking_concern.rb' - - 'app/controllers/concerns/web_app_controller_concern.rb' - - 'app/controllers/custom_css_controller.rb' - - 'app/controllers/disputes/appeals_controller.rb' - - 'app/controllers/disputes/base_controller.rb' - - 'app/controllers/disputes/strikes_controller.rb' - - 'app/controllers/emojis_controller.rb' - - 'app/controllers/filters/statuses_controller.rb' - - 'app/controllers/filters_controller.rb' - - 'app/controllers/follower_accounts_controller.rb' - - 'app/controllers/following_accounts_controller.rb' - - 'app/controllers/health_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/instance_actors_controller.rb' - - 'app/controllers/intents_controller.rb' - - 'app/controllers/invites_controller.rb' - - 'app/controllers/manifests_controller.rb' - - 'app/controllers/media_controller.rb' - - 'app/controllers/media_proxy_controller.rb' - - 'app/controllers/oauth/authorizations_controller.rb' - - 'app/controllers/oauth/authorized_applications_controller.rb' - - 'app/controllers/oauth/tokens_controller.rb' - - 'app/controllers/privacy_controller.rb' - - 'app/controllers/relationships_controller.rb' - - 'app/controllers/settings/aliases_controller.rb' - - 'app/controllers/settings/applications_controller.rb' - - 'app/controllers/settings/base_controller.rb' - - 'app/controllers/settings/deletes_controller.rb' - - 'app/controllers/settings/exports/blocked_accounts_controller.rb' - - 'app/controllers/settings/exports/blocked_domains_controller.rb' - - 'app/controllers/settings/exports/bookmarks_controller.rb' - - 'app/controllers/settings/exports/following_accounts_controller.rb' - - 'app/controllers/settings/exports/lists_controller.rb' - - 'app/controllers/settings/exports/muted_accounts_controller.rb' - - 'app/controllers/settings/exports_controller.rb' - - 'app/controllers/settings/featured_tags_controller.rb' - - 'app/controllers/settings/imports_controller.rb' - - 'app/controllers/settings/login_activities_controller.rb' - - 'app/controllers/settings/migration/redirects_controller.rb' - - 'app/controllers/settings/migrations_controller.rb' - - 'app/controllers/settings/pictures_controller.rb' - - 'app/controllers/settings/preferences/appearance_controller.rb' - - 'app/controllers/settings/preferences/notifications_controller.rb' - - 'app/controllers/settings/preferences/other_controller.rb' - - 'app/controllers/settings/preferences_controller.rb' - - 'app/controllers/settings/profiles_controller.rb' - - 'app/controllers/settings/sessions_controller.rb' - - 'app/controllers/settings/two_factor_authentication/confirmations_controller.rb' - - 'app/controllers/settings/two_factor_authentication/otp_authentication_controller.rb' - - 'app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb' - - 'app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb' - - 'app/controllers/settings/two_factor_authentication_methods_controller.rb' - - 'app/controllers/shares_controller.rb' - - 'app/controllers/statuses_cleanup_controller.rb' - - 'app/controllers/statuses_controller.rb' - - 'app/controllers/tags_controller.rb' - - 'app/controllers/well_known/host_meta_controller.rb' - - 'app/controllers/well_known/nodeinfo_controller.rb' - - 'app/controllers/well_known/webfinger_controller.rb' - - 'app/helpers/accounts_helper.rb' - - 'app/helpers/admin/account_moderation_notes_helper.rb' - - 'app/helpers/admin/action_logs_helper.rb' - - 'app/helpers/admin/dashboard_helper.rb' - - 'app/helpers/admin/filter_helper.rb' - - 'app/helpers/admin/settings_helper.rb' - - 'app/helpers/admin/trends/statuses_helper.rb' - - 'app/helpers/application_helper.rb' - - 'app/helpers/branding_helper.rb' - - 'app/helpers/context_helper.rb' - - 'app/helpers/domain_control_helper.rb' - - 'app/helpers/email_helper.rb' - - 'app/helpers/flashes_helper.rb' - - 'app/helpers/formatting_helper.rb' - - 'app/helpers/home_helper.rb' - - 'app/helpers/instance_helper.rb' - - 'app/helpers/jsonld_helper.rb' - - 'app/helpers/languages_helper.rb' - - 'app/helpers/mascot_helper.rb' - - 'app/helpers/routing_helper.rb' - - 'app/helpers/settings_helper.rb' - - 'app/helpers/statuses_helper.rb' - - 'app/helpers/webfinger_helper.rb' - - 'app/lib/access_token_extension.rb' - - 'app/lib/account_reach_finder.rb' - - 'app/lib/activity_tracker.rb' - - 'app/lib/activitypub/activity.rb' - - 'app/lib/activitypub/activity/accept.rb' - - 'app/lib/activitypub/activity/add.rb' - - 'app/lib/activitypub/activity/announce.rb' - - 'app/lib/activitypub/activity/block.rb' - - 'app/lib/activitypub/activity/create.rb' - - 'app/lib/activitypub/activity/delete.rb' - - 'app/lib/activitypub/activity/flag.rb' - - 'app/lib/activitypub/activity/follow.rb' - - 'app/lib/activitypub/activity/like.rb' - - 'app/lib/activitypub/activity/move.rb' - - 'app/lib/activitypub/activity/reject.rb' - - 'app/lib/activitypub/activity/remove.rb' - - 'app/lib/activitypub/activity/undo.rb' - - 'app/lib/activitypub/activity/update.rb' - - 'app/lib/activitypub/adapter.rb' - - 'app/lib/activitypub/case_transform.rb' - - 'app/lib/activitypub/dereferencer.rb' - - 'app/lib/activitypub/forwarder.rb' - - 'app/lib/activitypub/linked_data_signature.rb' - - 'app/lib/activitypub/parser/custom_emoji_parser.rb' - - 'app/lib/activitypub/parser/media_attachment_parser.rb' - - 'app/lib/activitypub/parser/poll_parser.rb' - - 'app/lib/activitypub/parser/status_parser.rb' - - 'app/lib/activitypub/serializer.rb' - - 'app/lib/activitypub/tag_manager.rb' - - 'app/lib/admin/metrics/dimension.rb' - - 'app/lib/admin/metrics/dimension/base_dimension.rb' - - 'app/lib/admin/metrics/dimension/instance_accounts_dimension.rb' - - 'app/lib/admin/metrics/dimension/instance_languages_dimension.rb' - - 'app/lib/admin/metrics/dimension/languages_dimension.rb' - - 'app/lib/admin/metrics/dimension/servers_dimension.rb' - - 'app/lib/admin/metrics/dimension/software_versions_dimension.rb' - - 'app/lib/admin/metrics/dimension/sources_dimension.rb' - - 'app/lib/admin/metrics/dimension/space_usage_dimension.rb' - - 'app/lib/admin/metrics/dimension/tag_languages_dimension.rb' - - 'app/lib/admin/metrics/dimension/tag_servers_dimension.rb' - - 'app/lib/admin/metrics/measure.rb' - - 'app/lib/admin/metrics/measure/active_users_measure.rb' - - 'app/lib/admin/metrics/measure/base_measure.rb' - - 'app/lib/admin/metrics/measure/instance_accounts_measure.rb' - - 'app/lib/admin/metrics/measure/instance_followers_measure.rb' - - 'app/lib/admin/metrics/measure/instance_follows_measure.rb' - - 'app/lib/admin/metrics/measure/instance_media_attachments_measure.rb' - - 'app/lib/admin/metrics/measure/instance_reports_measure.rb' - - 'app/lib/admin/metrics/measure/instance_statuses_measure.rb' - - 'app/lib/admin/metrics/measure/interactions_measure.rb' - - 'app/lib/admin/metrics/measure/new_users_measure.rb' - - 'app/lib/admin/metrics/measure/opened_reports_measure.rb' - - 'app/lib/admin/metrics/measure/resolved_reports_measure.rb' - - 'app/lib/admin/metrics/measure/tag_accounts_measure.rb' - - 'app/lib/admin/metrics/measure/tag_servers_measure.rb' - - 'app/lib/admin/metrics/measure/tag_uses_measure.rb' - - 'app/lib/admin/metrics/retention.rb' - - 'app/lib/admin/system_check.rb' - - 'app/lib/admin/system_check/base_check.rb' - - 'app/lib/admin/system_check/database_schema_check.rb' - - 'app/lib/admin/system_check/elasticsearch_check.rb' - - 'app/lib/admin/system_check/message.rb' - - 'app/lib/admin/system_check/rules_check.rb' - - 'app/lib/admin/system_check/sidekiq_process_check.rb' - - 'app/lib/application_extension.rb' - - 'app/lib/ascii_folding.rb' - - 'app/lib/cache_buster.rb' - - 'app/lib/connection_pool/shared_connection_pool.rb' - - 'app/lib/connection_pool/shared_timed_stack.rb' - - 'app/lib/delivery_failure_tracker.rb' - - 'app/lib/emoji_formatter.rb' - - 'app/lib/entity_cache.rb' - - 'app/lib/extractor.rb' - - 'app/lib/fast_geometry_parser.rb' - - 'app/lib/fast_ip_map.rb' - - 'app/lib/feed_manager.rb' - - 'app/lib/hash_object.rb' - - 'app/lib/hashtag_normalizer.rb' - - 'app/lib/html_aware_formatter.rb' - - 'app/lib/importer/accounts_index_importer.rb' - - 'app/lib/importer/base_importer.rb' - - 'app/lib/importer/statuses_index_importer.rb' - - 'app/lib/importer/tags_index_importer.rb' - - 'app/lib/inline_renderer.rb' - - 'app/lib/link_details_extractor.rb' - - 'app/lib/nodeinfo/adapter.rb' - - 'app/lib/ostatus/tag_manager.rb' - - 'app/lib/permalink_redirector.rb' - - 'app/lib/plain_text_formatter.rb' - - 'app/lib/potential_friendship_tracker.rb' - - 'app/lib/rate_limiter.rb' - - 'app/lib/redis_configuration.rb' - - 'app/lib/request.rb' - - 'app/lib/request_pool.rb' - - 'app/lib/response_with_limit.rb' - - 'app/lib/rss/builder.rb' - - 'app/lib/rss/channel.rb' - - 'app/lib/rss/element.rb' - - 'app/lib/rss/item.rb' - - 'app/lib/rss/media_content.rb' - - 'app/lib/scope_parser.rb' - - 'app/lib/scope_transformer.rb' - - 'app/lib/search_query_parser.rb' - - 'app/lib/search_query_transformer.rb' - - 'app/lib/settings/extend.rb' - - 'app/lib/settings/scoped_settings.rb' - - 'app/lib/status_cache_hydrator.rb' - - 'app/lib/status_filter.rb' - - 'app/lib/status_finder.rb' - - 'app/lib/status_reach_finder.rb' - - 'app/lib/suspicious_sign_in_detector.rb' - - 'app/lib/tag_manager.rb' - - 'app/lib/text_formatter.rb' - - 'app/lib/themes.rb' - - 'app/lib/translation_service.rb' - - 'app/lib/translation_service/deepl.rb' - - 'app/lib/translation_service/libre_translate.rb' - - 'app/lib/translation_service/translation.rb' - - 'app/lib/user_settings_decorator.rb' - - 'app/lib/vacuum.rb' - - 'app/lib/vacuum/access_tokens_vacuum.rb' - - 'app/lib/vacuum/backups_vacuum.rb' - - 'app/lib/vacuum/feeds_vacuum.rb' - - 'app/lib/vacuum/media_attachments_vacuum.rb' - - 'app/lib/vacuum/preview_cards_vacuum.rb' - - 'app/lib/vacuum/statuses_vacuum.rb' - - 'app/lib/vacuum/system_keys_vacuum.rb' - - 'app/lib/validation_error_formatter.rb' - - 'app/lib/video_metadata_extractor.rb' - - 'app/lib/webfinger.rb' - - 'app/lib/webfinger_resource.rb' - - 'app/mailers/admin_mailer.rb' - - 'app/mailers/application_mailer.rb' - - 'app/mailers/notification_mailer.rb' - - 'app/mailers/user_mailer.rb' - - 'app/models/account.rb' - - 'app/models/account/field.rb' - - 'app/models/account_alias.rb' - - 'app/models/account_conversation.rb' - - 'app/models/account_domain_block.rb' - - 'app/models/account_filter.rb' - - 'app/models/account_migration.rb' - - 'app/models/account_moderation_note.rb' - - 'app/models/account_pin.rb' - - 'app/models/account_stat.rb' - - 'app/models/account_statuses_filter.rb' - - 'app/models/account_suggestions.rb' - - 'app/models/account_suggestions/global_source.rb' - - 'app/models/account_suggestions/past_interactions_source.rb' - - 'app/models/account_suggestions/setting_source.rb' - - 'app/models/account_suggestions/source.rb' - - 'app/models/account_suggestions/suggestion.rb' - - 'app/models/account_summary.rb' - - 'app/models/account_warning.rb' - - 'app/models/account_warning_preset.rb' - - 'app/models/admin.rb' - - 'app/models/admin/account_action.rb' - - 'app/models/admin/action_log.rb' - - 'app/models/admin/action_log_filter.rb' - - 'app/models/admin/appeal_filter.rb' - - 'app/models/admin/status_batch_action.rb' - - 'app/models/admin/status_filter.rb' - - 'app/models/announcement.rb' - - 'app/models/announcement_filter.rb' - - 'app/models/announcement_mute.rb' - - 'app/models/announcement_reaction.rb' - - 'app/models/application_record.rb' - - 'app/models/backup.rb' - - 'app/models/block.rb' - - 'app/models/bookmark.rb' - - 'app/models/canonical_email_block.rb' - - 'app/models/concerns/account_associations.rb' - - 'app/models/concerns/account_avatar.rb' - - 'app/models/concerns/account_counters.rb' - - 'app/models/concerns/account_finder_concern.rb' - - 'app/models/concerns/account_header.rb' - - 'app/models/concerns/account_interactions.rb' - - 'app/models/concerns/account_merging.rb' - - 'app/models/concerns/attachmentable.rb' - - 'app/models/concerns/cacheable.rb' - - 'app/models/concerns/domain_materializable.rb' - - 'app/models/concerns/domain_normalizable.rb' - - 'app/models/concerns/expireable.rb' - - 'app/models/concerns/follow_limitable.rb' - - 'app/models/concerns/ldap_authenticable.rb' - - 'app/models/concerns/lockable.rb' - - 'app/models/concerns/omniauthable.rb' - - 'app/models/concerns/paginable.rb' - - 'app/models/concerns/pam_authenticable.rb' - - 'app/models/concerns/rate_limitable.rb' - - 'app/models/concerns/redisable.rb' - - 'app/models/concerns/relationship_cacheable.rb' - - 'app/models/concerns/remotable.rb' - - 'app/models/concerns/status_snapshot_concern.rb' - - 'app/models/concerns/status_threading_concern.rb' - - 'app/models/content_retention_policy.rb' - - 'app/models/context.rb' - - 'app/models/conversation.rb' - - 'app/models/conversation_mute.rb' - - 'app/models/custom_emoji.rb' - - 'app/models/custom_emoji_category.rb' - - 'app/models/custom_emoji_filter.rb' - - 'app/models/custom_filter.rb' - - 'app/models/custom_filter_keyword.rb' - - 'app/models/custom_filter_status.rb' - - 'app/models/device.rb' - - 'app/models/domain_allow.rb' - - 'app/models/domain_block.rb' - - 'app/models/email_domain_block.rb' - - 'app/models/encrypted_message.rb' - - 'app/models/export.rb' - - 'app/models/extended_description.rb' - - 'app/models/favourite.rb' - - 'app/models/featured_tag.rb' - - 'app/models/feed.rb' - - 'app/models/follow.rb' - - 'app/models/follow_recommendation.rb' - - 'app/models/follow_recommendation_filter.rb' - - 'app/models/follow_recommendation_suppression.rb' - - 'app/models/follow_request.rb' - - 'app/models/form/account_batch.rb' - - 'app/models/form/admin_settings.rb' - - 'app/models/form/challenge.rb' - - 'app/models/form/custom_emoji_batch.rb' - - 'app/models/form/delete_confirmation.rb' - - 'app/models/form/domain_block_batch.rb' - - 'app/models/form/email_domain_block_batch.rb' - - 'app/models/form/ip_block_batch.rb' - - 'app/models/form/redirect.rb' - - 'app/models/form/status_filter_batch_action.rb' - - 'app/models/form/two_factor_confirmation.rb' - - 'app/models/home_feed.rb' - - 'app/models/identity.rb' - - 'app/models/import.rb' - - 'app/models/instance.rb' - - 'app/models/instance_filter.rb' - - 'app/models/invite.rb' - - 'app/models/invite_filter.rb' - - 'app/models/ip_block.rb' - - 'app/models/list.rb' - - 'app/models/list_account.rb' - - 'app/models/list_feed.rb' - - 'app/models/login_activity.rb' - - 'app/models/marker.rb' - - 'app/models/media_attachment.rb' - - 'app/models/mention.rb' - - 'app/models/message_franking.rb' - - 'app/models/mute.rb' - - 'app/models/notification.rb' - - 'app/models/one_time_key.rb' - - 'app/models/poll.rb' - - 'app/models/poll_vote.rb' - - 'app/models/preview_card.rb' - - 'app/models/preview_card_provider.rb' - - 'app/models/privacy_policy.rb' - - 'app/models/public_feed.rb' - - 'app/models/relationship_filter.rb' - - 'app/models/relay.rb' - - 'app/models/remote_follow.rb' - - 'app/models/report.rb' - - 'app/models/report_filter.rb' - - 'app/models/report_note.rb' - - 'app/models/scheduled_status.rb' - - 'app/models/search.rb' - - 'app/models/session_activation.rb' - - 'app/models/setting.rb' - - 'app/models/site_upload.rb' - - 'app/models/status.rb' - - 'app/models/status_edit.rb' - - 'app/models/status_pin.rb' - - 'app/models/status_stat.rb' - - 'app/models/status_trend.rb' - - 'app/models/tag.rb' - - 'app/models/tag_feed.rb' - - 'app/models/tag_follow.rb' - - 'app/models/tombstone.rb' - - 'app/models/trends.rb' - - 'app/models/trends/base.rb' - - 'app/models/trends/history.rb' - - 'app/models/trends/links.rb' - - 'app/models/trends/preview_card_batch.rb' - - 'app/models/trends/preview_card_filter.rb' - - 'app/models/trends/preview_card_provider_batch.rb' - - 'app/models/trends/preview_card_provider_filter.rb' - - 'app/models/trends/query.rb' - - 'app/models/trends/status_batch.rb' - - 'app/models/trends/status_filter.rb' - - 'app/models/trends/statuses.rb' - - 'app/models/trends/tag_batch.rb' - - 'app/models/trends/tag_filter.rb' - - 'app/models/trends/tags.rb' - - 'app/models/unavailable_domain.rb' - - 'app/models/user.rb' - - 'app/models/user_invite_request.rb' - - 'app/models/user_ip.rb' - - 'app/models/user_role.rb' - - 'app/models/web.rb' - - 'app/models/web/push_subscription.rb' - - 'app/models/web/setting.rb' - - 'app/models/webauthn_credential.rb' - - 'app/models/webhook.rb' - - 'app/policies/account_moderation_note_policy.rb' - - 'app/policies/account_policy.rb' - - 'app/policies/account_warning_policy.rb' - - 'app/policies/account_warning_preset_policy.rb' - - 'app/policies/admin/status_policy.rb' - - 'app/policies/announcement_policy.rb' - - 'app/policies/appeal_policy.rb' - - 'app/policies/application_policy.rb' - - 'app/policies/audit_log_policy.rb' - - 'app/policies/backup_policy.rb' - - 'app/policies/canonical_email_block_policy.rb' - - 'app/policies/custom_emoji_policy.rb' - - 'app/policies/dashboard_policy.rb' - - 'app/policies/delivery_policy.rb' - - 'app/policies/domain_allow_policy.rb' - - 'app/policies/domain_block_policy.rb' - - 'app/policies/email_domain_block_policy.rb' - - 'app/policies/follow_recommendation_policy.rb' - - 'app/policies/instance_policy.rb' - - 'app/policies/invite_policy.rb' - - 'app/policies/ip_block_policy.rb' - - 'app/policies/poll_policy.rb' - - 'app/policies/preview_card_policy.rb' - - 'app/policies/preview_card_provider_policy.rb' - - 'app/policies/relay_policy.rb' - - 'app/policies/report_note_policy.rb' - - 'app/policies/report_policy.rb' - - 'app/policies/rule_policy.rb' - - 'app/policies/settings_policy.rb' - - 'app/policies/status_policy.rb' - - 'app/policies/tag_policy.rb' - - 'app/policies/user_policy.rb' - - 'app/policies/user_role_policy.rb' - - 'app/policies/webhook_policy.rb' - - 'app/presenters/account_relationships_presenter.rb' - - 'app/presenters/activitypub/activity_presenter.rb' - - 'app/presenters/activitypub/collection_presenter.rb' - - 'app/presenters/familiar_followers_presenter.rb' - - 'app/presenters/filter_result_presenter.rb' - - 'app/presenters/initial_state_presenter.rb' - - 'app/presenters/instance_presenter.rb' - - 'app/presenters/status_relationships_presenter.rb' - - 'app/presenters/tag_relationships_presenter.rb' - - 'app/presenters/webhooks/event_presenter.rb' - - 'app/serializers/activitypub/accept_follow_serializer.rb' - - 'app/serializers/activitypub/activity_serializer.rb' - - 'app/serializers/activitypub/actor_serializer.rb' - - 'app/serializers/activitypub/add_serializer.rb' - - 'app/serializers/activitypub/block_serializer.rb' - - 'app/serializers/activitypub/collection_serializer.rb' - - 'app/serializers/activitypub/delete_actor_serializer.rb' - - 'app/serializers/activitypub/delete_serializer.rb' - - 'app/serializers/activitypub/device_serializer.rb' - - 'app/serializers/activitypub/emoji_serializer.rb' - - 'app/serializers/activitypub/encrypted_message_serializer.rb' - - 'app/serializers/activitypub/flag_serializer.rb' - - 'app/serializers/activitypub/follow_serializer.rb' - - 'app/serializers/activitypub/hashtag_serializer.rb' - - 'app/serializers/activitypub/image_serializer.rb' - - 'app/serializers/activitypub/like_serializer.rb' - - 'app/serializers/activitypub/move_serializer.rb' - - 'app/serializers/activitypub/note_serializer.rb' - - 'app/serializers/activitypub/one_time_key_serializer.rb' - - 'app/serializers/activitypub/outbox_serializer.rb' - - 'app/serializers/activitypub/public_key_serializer.rb' - - 'app/serializers/activitypub/reject_follow_serializer.rb' - - 'app/serializers/activitypub/remove_serializer.rb' - - 'app/serializers/activitypub/undo_announce_serializer.rb' - - 'app/serializers/activitypub/undo_block_serializer.rb' - - 'app/serializers/activitypub/undo_follow_serializer.rb' - - 'app/serializers/activitypub/undo_like_serializer.rb' - - 'app/serializers/activitypub/update_poll_serializer.rb' - - 'app/serializers/activitypub/update_serializer.rb' - - 'app/serializers/activitypub/vote_serializer.rb' - - 'app/serializers/initial_state_serializer.rb' - - 'app/serializers/manifest_serializer.rb' - - 'app/serializers/nodeinfo/discovery_serializer.rb' - - 'app/serializers/nodeinfo/serializer.rb' - - 'app/serializers/oembed_serializer.rb' - - 'app/serializers/rest/account_serializer.rb' - - 'app/serializers/rest/admin/account_serializer.rb' - - 'app/serializers/rest/admin/canonical_email_block_serializer.rb' - - 'app/serializers/rest/admin/cohort_serializer.rb' - - 'app/serializers/rest/admin/dimension_serializer.rb' - - 'app/serializers/rest/admin/domain_allow_serializer.rb' - - 'app/serializers/rest/admin/domain_block_serializer.rb' - - 'app/serializers/rest/admin/email_domain_block_serializer.rb' - - 'app/serializers/rest/admin/existing_domain_block_error_serializer.rb' - - 'app/serializers/rest/admin/ip_block_serializer.rb' - - 'app/serializers/rest/admin/ip_serializer.rb' - - 'app/serializers/rest/admin/measure_serializer.rb' - - 'app/serializers/rest/admin/report_serializer.rb' - - 'app/serializers/rest/admin/tag_serializer.rb' - - 'app/serializers/rest/admin/webhook_event_serializer.rb' - - 'app/serializers/rest/announcement_serializer.rb' - - 'app/serializers/rest/application_serializer.rb' - - 'app/serializers/rest/context_serializer.rb' - - 'app/serializers/rest/conversation_serializer.rb' - - 'app/serializers/rest/credential_account_serializer.rb' - - 'app/serializers/rest/custom_emoji_serializer.rb' - - 'app/serializers/rest/domain_block_serializer.rb' - - 'app/serializers/rest/encrypted_message_serializer.rb' - - 'app/serializers/rest/extended_description_serializer.rb' - - 'app/serializers/rest/familiar_followers_serializer.rb' - - 'app/serializers/rest/featured_tag_serializer.rb' - - 'app/serializers/rest/filter_keyword_serializer.rb' - - 'app/serializers/rest/filter_result_serializer.rb' - - 'app/serializers/rest/filter_serializer.rb' - - 'app/serializers/rest/filter_status_serializer.rb' - - 'app/serializers/rest/instance_serializer.rb' - - 'app/serializers/rest/keys/claim_result_serializer.rb' - - 'app/serializers/rest/keys/device_serializer.rb' - - 'app/serializers/rest/keys/query_result_serializer.rb' - - 'app/serializers/rest/list_serializer.rb' - - 'app/serializers/rest/marker_serializer.rb' - - 'app/serializers/rest/media_attachment_serializer.rb' - - 'app/serializers/rest/muted_account_serializer.rb' - - 'app/serializers/rest/notification_serializer.rb' - - 'app/serializers/rest/poll_serializer.rb' - - 'app/serializers/rest/preferences_serializer.rb' - - 'app/serializers/rest/preview_card_serializer.rb' - - 'app/serializers/rest/privacy_policy_serializer.rb' - - 'app/serializers/rest/reaction_serializer.rb' - - 'app/serializers/rest/relationship_serializer.rb' - - 'app/serializers/rest/report_serializer.rb' - - 'app/serializers/rest/role_serializer.rb' - - 'app/serializers/rest/rule_serializer.rb' - - 'app/serializers/rest/scheduled_status_serializer.rb' - - 'app/serializers/rest/search_serializer.rb' - - 'app/serializers/rest/status_edit_serializer.rb' - - 'app/serializers/rest/status_serializer.rb' - - 'app/serializers/rest/status_source_serializer.rb' - - 'app/serializers/rest/suggestion_serializer.rb' - - 'app/serializers/rest/tag_serializer.rb' - - 'app/serializers/rest/translation_serializer.rb' - - 'app/serializers/rest/trends/link_serializer.rb' - - 'app/serializers/rest/v1/filter_serializer.rb' - - 'app/serializers/rest/v1/instance_serializer.rb' - - 'app/serializers/rest/web_push_subscription_serializer.rb' - - 'app/serializers/web/notification_serializer.rb' - - 'app/serializers/webfinger_serializer.rb' - - 'app/services/account_search_service.rb' - - 'app/services/account_statuses_cleanup_service.rb' - - 'app/services/activitypub/fetch_featured_collection_service.rb' - - 'app/services/activitypub/fetch_featured_tags_collection_service.rb' - - 'app/services/activitypub/fetch_remote_account_service.rb' - - 'app/services/activitypub/fetch_remote_actor_service.rb' - - 'app/services/activitypub/fetch_remote_key_service.rb' - - 'app/services/activitypub/fetch_remote_poll_service.rb' - - 'app/services/activitypub/fetch_remote_status_service.rb' - - 'app/services/activitypub/fetch_replies_service.rb' - - 'app/services/activitypub/prepare_followers_synchronization_service.rb' - - 'app/services/activitypub/process_account_service.rb' - - 'app/services/activitypub/process_collection_service.rb' - - 'app/services/activitypub/process_status_update_service.rb' - - 'app/services/activitypub/synchronize_followers_service.rb' - - 'app/services/after_block_domain_from_account_service.rb' - - 'app/services/after_block_service.rb' - - 'app/services/after_unallow_domain_service.rb' - - 'app/services/app_sign_up_service.rb' - - 'app/services/appeal_service.rb' - - 'app/services/approve_appeal_service.rb' - - 'app/services/authorize_follow_service.rb' - - 'app/services/backup_service.rb' - - 'app/services/base_service.rb' - - 'app/services/batched_remove_status_service.rb' - - 'app/services/block_domain_service.rb' - - 'app/services/block_service.rb' - - 'app/services/bootstrap_timeline_service.rb' - - 'app/services/clear_domain_media_service.rb' - - 'app/services/concerns/payloadable.rb' - - 'app/services/create_featured_tag_service.rb' - - 'app/services/delete_account_service.rb' - - 'app/services/deliver_to_device_service.rb' - - 'app/services/fan_out_on_write_service.rb' - - 'app/services/favourite_service.rb' - - 'app/services/fetch_link_card_service.rb' - - 'app/services/fetch_oembed_service.rb' - - 'app/services/fetch_remote_status_service.rb' - - 'app/services/fetch_resource_service.rb' - - 'app/services/follow_migration_service.rb' - - 'app/services/follow_service.rb' - - 'app/services/import_service.rb' - - 'app/services/keys/claim_service.rb' - - 'app/services/keys/query_service.rb' - - 'app/services/move_service.rb' - - 'app/services/mute_service.rb' - - 'app/services/notify_service.rb' - - 'app/services/post_status_service.rb' - - 'app/services/precompute_feed_service.rb' - - 'app/services/process_hashtags_service.rb' - - 'app/services/process_mentions_service.rb' - - 'app/services/purge_domain_service.rb' - - 'app/services/reblog_service.rb' - - 'app/services/reject_follow_service.rb' - - 'app/services/remove_domains_from_followers_service.rb' - - 'app/services/remove_featured_tag_service.rb' - - 'app/services/remove_from_followers_service.rb' - - 'app/services/remove_status_service.rb' - - 'app/services/report_service.rb' - - 'app/services/resolve_account_service.rb' - - 'app/services/resolve_url_service.rb' - - 'app/services/search_service.rb' - - 'app/services/suspend_account_service.rb' - - 'app/services/tag_search_service.rb' - - 'app/services/translate_status_service.rb' - - 'app/services/unallow_domain_service.rb' - - 'app/services/unblock_domain_service.rb' - - 'app/services/unblock_service.rb' - - 'app/services/unfavourite_service.rb' - - 'app/services/unfollow_service.rb' - - 'app/services/unmute_service.rb' - - 'app/services/unsuspend_account_service.rb' - - 'app/services/update_account_service.rb' - - 'app/services/update_status_service.rb' - - 'app/services/verify_link_service.rb' - - 'app/services/vote_service.rb' - - 'app/services/webhook_service.rb' - - 'app/validators/blacklisted_email_validator.rb' - - 'app/validators/disallowed_hashtags_validator.rb' - - 'app/validators/domain_validator.rb' - - 'app/validators/ed25519_key_validator.rb' - - 'app/validators/ed25519_signature_validator.rb' - - 'app/validators/email_mx_validator.rb' - - 'app/validators/existing_username_validator.rb' - - 'app/validators/follow_limit_validator.rb' - - 'app/validators/import_validator.rb' - - 'app/validators/language_validator.rb' - - 'app/validators/note_length_validator.rb' - - 'app/validators/poll_validator.rb' - - 'app/validators/reaction_validator.rb' - - 'app/validators/registration_form_time_validator.rb' - - 'app/validators/status_length_validator.rb' - - 'app/validators/status_pin_validator.rb' - - 'app/validators/unique_username_validator.rb' - - 'app/validators/unreserved_username_validator.rb' - - 'app/validators/url_validator.rb' - - 'app/validators/vote_validator.rb' - - 'app/workers/account_deletion_worker.rb' - - 'app/workers/account_merging_worker.rb' - - 'app/workers/activitypub/account_raw_distribution_worker.rb' - - 'app/workers/activitypub/delivery_worker.rb' - - 'app/workers/activitypub/distribute_poll_update_worker.rb' - - 'app/workers/activitypub/distribution_worker.rb' - - 'app/workers/activitypub/fetch_replies_worker.rb' - - 'app/workers/activitypub/followers_synchronization_worker.rb' - - 'app/workers/activitypub/low_priority_delivery_worker.rb' - - 'app/workers/activitypub/migrated_follow_delivery_worker.rb' - - 'app/workers/activitypub/move_distribution_worker.rb' - - 'app/workers/activitypub/post_upgrade_worker.rb' - - 'app/workers/activitypub/processing_worker.rb' - - 'app/workers/activitypub/raw_distribution_worker.rb' - - 'app/workers/activitypub/status_update_distribution_worker.rb' - - 'app/workers/activitypub/synchronize_featured_collection_worker.rb' - - 'app/workers/activitypub/synchronize_featured_tags_collection_worker.rb' - - 'app/workers/activitypub/update_distribution_worker.rb' - - 'app/workers/admin/account_deletion_worker.rb' - - 'app/workers/admin/domain_purge_worker.rb' - - 'app/workers/admin/suspension_worker.rb' - - 'app/workers/admin/unsuspension_worker.rb' - - 'app/workers/after_account_domain_block_worker.rb' - - 'app/workers/after_unallow_domain_worker.rb' - - 'app/workers/authorize_follow_worker.rb' - - 'app/workers/backup_worker.rb' - - 'app/workers/block_worker.rb' - - 'app/workers/bootstrap_timeline_worker.rb' - - 'app/workers/cache_buster_worker.rb' - - 'app/workers/concerns/exponential_backoff.rb' - - 'app/workers/delete_mute_worker.rb' - - 'app/workers/distribution_worker.rb' - - 'app/workers/domain_block_worker.rb' - - 'app/workers/domain_clear_media_worker.rb' - - 'app/workers/feed_insert_worker.rb' - - 'app/workers/fetch_reply_worker.rb' - - 'app/workers/import/relationship_worker.rb' - - 'app/workers/import_worker.rb' - - 'app/workers/link_crawl_worker.rb' - - 'app/workers/local_notification_worker.rb' - - 'app/workers/merge_worker.rb' - - 'app/workers/move_worker.rb' - - 'app/workers/mute_worker.rb' - - 'app/workers/poll_expiration_notify_worker.rb' - - 'app/workers/post_process_media_worker.rb' - - 'app/workers/publish_announcement_reaction_worker.rb' - - 'app/workers/publish_scheduled_announcement_worker.rb' - - 'app/workers/publish_scheduled_status_worker.rb' - - 'app/workers/push_conversation_worker.rb' - - 'app/workers/push_encrypted_message_worker.rb' - - 'app/workers/push_update_worker.rb' - - 'app/workers/redownload_avatar_worker.rb' - - 'app/workers/redownload_header_worker.rb' - - 'app/workers/redownload_media_worker.rb' - - 'app/workers/refollow_worker.rb' - - 'app/workers/regeneration_worker.rb' - - 'app/workers/remote_account_refresh_worker.rb' - - 'app/workers/removal_worker.rb' - - 'app/workers/remove_featured_tag_worker.rb' - - 'app/workers/resolve_account_worker.rb' - - 'app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb' - - 'app/workers/scheduler/follow_recommendations_scheduler.rb' - - 'app/workers/scheduler/indexing_scheduler.rb' - - 'app/workers/scheduler/instance_refresh_scheduler.rb' - - 'app/workers/scheduler/ip_cleanup_scheduler.rb' - - 'app/workers/scheduler/pghero_scheduler.rb' - - 'app/workers/scheduler/scheduled_statuses_scheduler.rb' - - 'app/workers/scheduler/suspended_user_cleanup_scheduler.rb' - - 'app/workers/scheduler/trends/refresh_scheduler.rb' - - 'app/workers/scheduler/trends/review_notifications_scheduler.rb' - - 'app/workers/scheduler/user_cleanup_scheduler.rb' - - 'app/workers/scheduler/vacuum_scheduler.rb' - - 'app/workers/thread_resolve_worker.rb' - - 'app/workers/trigger_webhook_worker.rb' - - 'app/workers/unfavourite_worker.rb' - - 'app/workers/unfollow_follow_worker.rb' - - 'app/workers/unmerge_worker.rb' - - 'app/workers/unpublish_announcement_worker.rb' - - 'app/workers/verify_account_links_worker.rb' - - 'app/workers/web/push_notification_worker.rb' - - 'app/workers/webhooks/delivery_worker.rb' - - 'db/migrate/20160220174730_create_accounts.rb' - - 'db/migrate/20160220211917_create_statuses.rb' - - 'db/migrate/20160221003140_create_users.rb' - - 'db/migrate/20160221003621_create_follows.rb' - - 'db/migrate/20160222122600_create_stream_entries.rb' - - 'db/migrate/20160222143943_add_profile_fields_to_accounts.rb' - - 'db/migrate/20160223162837_add_metadata_to_statuses.rb' - - 'db/migrate/20160223164502_make_uris_nullable_in_statuses.rb' - - 'db/migrate/20160223165723_add_url_to_statuses.rb' - - 'db/migrate/20160223165855_add_url_to_accounts.rb' - - 'db/migrate/20160223171800_create_favourites.rb' - - 'db/migrate/20160224223247_create_mentions.rb' - - 'db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb' - - 'db/migrate/20160305115639_add_devise_to_users.rb' - - 'db/migrate/20160306172223_create_doorkeeper_tables.rb' - - 'db/migrate/20160312193225_add_attachment_header_to_accounts.rb' - - 'db/migrate/20160314164231_add_owner_to_application.rb' - - 'db/migrate/20160316103650_add_missing_indices.rb' - - 'db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb' - - 'db/migrate/20160325130944_add_admin_to_users.rb' - - 'db/migrate/20160826155805_add_superapp_to_oauth_applications.rb' - - 'db/migrate/20160905150353_create_media_attachments.rb' - - 'db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb' - - 'db/migrate/20160920003904_remove_verify_token_from_accounts.rb' - - 'db/migrate/20160926213048_remove_owner_from_application.rb' - - 'db/migrate/20161003142332_add_confirmable_to_users.rb' - - 'db/migrate/20161003145426_create_blocks.rb' - - 'db/migrate/20161006213403_rails_settings_migration.rb' - - 'db/migrate/20161009120834_create_domain_blocks.rb' - - 'db/migrate/20161027172456_add_silenced_to_accounts.rb' - - 'db/migrate/20161104173623_create_tags.rb' - - 'db/migrate/20161105130633_create_statuses_tags_join_table.rb' - - 'db/migrate/20161116162355_add_locale_to_users.rb' - - 'db/migrate/20161119211120_create_notifications.rb' - - 'db/migrate/20161122163057_remove_unneeded_indexes.rb' - - 'db/migrate/20161123093447_add_sensitive_to_statuses.rb' - - 'db/migrate/20161128103007_create_subscriptions.rb' - - 'db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb' - - 'db/migrate/20161130185319_add_visibility_to_statuses.rb' - - 'db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb' - - 'db/migrate/20161203164520_add_from_account_id_to_notifications.rb' - - 'db/migrate/20161205214545_add_suspended_to_accounts.rb' - - 'db/migrate/20161221152630_add_hidden_to_stream_entries.rb' - - 'db/migrate/20161222201034_add_locked_to_accounts.rb' - - 'db/migrate/20161222204147_create_follow_requests.rb' - - 'db/migrate/20170105224407_add_shortcode_to_media_attachments.rb' - - 'db/migrate/20170109120109_create_web_settings.rb' - - 'db/migrate/20170112154826_migrate_settings.rb' - - 'db/migrate/20170114194937_add_application_to_statuses.rb' - - 'db/migrate/20170114203041_add_website_to_oauth_application.rb' - - 'db/migrate/20170119214911_create_preview_cards.rb' - - 'db/migrate/20170123162658_add_severity_to_domain_blocks.rb' - - 'db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb' - - 'db/migrate/20170125145934_add_spoiler_text_to_statuses.rb' - - 'db/migrate/20170127165745_add_devise_two_factor_to_users.rb' - - 'db/migrate/20170205175257_remove_devices.rb' - - 'db/migrate/20170209184350_add_reply_to_statuses.rb' - - 'db/migrate/20170214110202_create_reports.rb' - - 'db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb' - - 'db/migrate/20170301222600_create_mutes.rb' - - 'db/migrate/20170303212857_add_last_emailed_at_to_users.rb' - - 'db/migrate/20170304202101_add_type_to_media_attachments.rb' - - 'db/migrate/20170317193015_add_search_index_to_accounts.rb' - - 'db/migrate/20170318214217_add_header_remote_url_to_accounts.rb' - - 'db/migrate/20170322021028_add_lowercase_index_to_accounts.rb' - - 'db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb' - - 'db/migrate/20170322162804_add_search_index_to_tags.rb' - - 'db/migrate/20170330021336_add_counter_caches.rb' - - 'db/migrate/20170330163835_create_imports.rb' - - 'db/migrate/20170330164118_add_attachment_data_to_imports.rb' - - 'db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb' - - 'db/migrate/20170405112956_add_index_on_mentions_status_id.rb' - - 'db/migrate/20170406215816_add_notifications_and_favourites_indices.rb' - - 'db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb' - - 'db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb' - - 'db/migrate/20170414132105_add_language_to_statuses.rb' - - 'db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb' - - 'db/migrate/20170423005413_add_allowed_languages_to_user.rb' - - 'db/migrate/20170424003227_create_account_domain_blocks.rb' - - 'db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb' - - 'db/migrate/20170425131920_add_media_attachment_meta.rb' - - 'db/migrate/20170425202925_add_oembed_to_preview_cards.rb' - - 'db/migrate/20170427011934_re_add_owner_to_application.rb' - - 'db/migrate/20170506235850_create_conversations.rb' - - 'db/migrate/20170507000211_add_conversation_id_to_statuses.rb' - - 'db/migrate/20170507141759_optimize_index_subscriptions.rb' - - 'db/migrate/20170508230434_create_conversation_mutes.rb' - - 'db/migrate/20170516072309_add_index_accounts_on_uri.rb' - - 'db/migrate/20170520145338_change_language_filter_to_opt_out.rb' - - 'db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb' - - 'db/migrate/20170604144747_add_foreign_keys_for_accounts.rb' - - 'db/migrate/20170606113804_change_tag_search_index_to_btree.rb' - - 'db/migrate/20170609145826_remove_default_language_from_statuses.rb' - - 'db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb' - - 'db/migrate/20170623152212_create_session_activations.rb' - - 'db/migrate/20170624134742_add_description_to_session_activations.rb' - - 'db/migrate/20170625140443_add_access_token_id_to_session_activations.rb' - - 'db/migrate/20170711225116_fix_null_booleans.rb' - - 'db/migrate/20170713112503_make_tag_search_case_insensitive.rb' - - 'db/migrate/20170713175513_create_web_push_subscriptions.rb' - - 'db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb' - - 'db/migrate/20170714184731_add_domain_to_subscriptions.rb' - - 'db/migrate/20170716191202_add_hide_notifications_to_mute.rb' - - 'db/migrate/20170718211102_add_activitypub_to_accounts.rb' - - 'db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb' - - 'db/migrate/20170823162448_create_status_pins.rb' - - 'db/migrate/20170824103029_add_timestamps_to_status_pins.rb' - - 'db/migrate/20170829215220_remove_status_pins_account_index.rb' - - 'db/migrate/20170901141119_truncate_preview_cards.rb' - - 'db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb' - - 'db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb' - - 'db/migrate/20170905165803_add_local_to_statuses.rb' - - 'db/migrate/20170913000752_create_site_uploads.rb' - - 'db/migrate/20170917153509_create_custom_emojis.rb' - - 'db/migrate/20170918125918_ids_to_bigints.rb' - - 'db/migrate/20170920024819_status_ids_to_timestamp_ids.rb' - - 'db/migrate/20170920032311_fix_reblogs_in_feeds.rb' - - 'db/migrate/20170924022025_ids_to_bigints2.rb' - - 'db/migrate/20170927215609_add_description_to_media_attachments.rb' - - 'db/migrate/20170928082043_create_email_domain_blocks.rb' - - 'db/migrate/20171005102658_create_account_moderation_notes.rb' - - 'db/migrate/20171005171936_add_disabled_to_custom_emojis.rb' - - 'db/migrate/20171006142024_add_uri_to_custom_emojis.rb' - - 'db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb' - - 'db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb' - - 'db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb' - - 'db/migrate/20171028221157_add_reblogs_to_follows.rb' - - 'db/migrate/20171107143332_add_memorial_to_accounts.rb' - - 'db/migrate/20171107143624_add_disabled_to_users.rb' - - 'db/migrate/20171109012327_add_moderator_to_accounts.rb' - - 'db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb' - - 'db/migrate/20171114231651_create_lists.rb' - - 'db/migrate/20171116161857_create_list_accounts.rb' - - 'db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb' - - 'db/migrate/20171119172437_create_admin_action_logs.rb' - - 'db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb' - - 'db/migrate/20171125024930_create_invites.rb' - - 'db/migrate/20171125031751_add_invite_id_to_users.rb' - - 'db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb' - - 'db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb' - - 'db/migrate/20171129172043_add_index_on_stream_entries.rb' - - 'db/migrate/20171130000000_add_embed_url_to_preview_cards.rb' - - 'db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb' - - 'db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb' - - 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' - - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180109143959_add_remember_token_to_users.rb' - - 'db/migrate/20180204034416_create_identities.rb' - - 'db/migrate/20180206000000_change_user_id_nonnullable.rb' - - 'db/migrate/20180211015820_create_backups.rb' - - 'db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb' - - 'db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb' - - 'db/migrate/20180402031200_add_assigned_account_id_to_reports.rb' - - 'db/migrate/20180402040909_create_report_notes.rb' - - 'db/migrate/20180410204633_add_fields_to_accounts.rb' - - 'db/migrate/20180416210259_add_uri_to_relationships.rb' - - 'db/migrate/20180506221944_add_actor_type_to_accounts.rb' - - 'db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb' - - 'db/migrate/20180510230049_migrate_web_push_subscriptions.rb' - - 'db/migrate/20180514130000_improve_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180528141303_fix_accounts_unique_index.rb' - - 'db/migrate/20180608213548_reject_following_blocked_users.rb' - - 'db/migrate/20180609104432_migrate_web_push_subscriptions2.rb' - - 'db/migrate/20180615122121_add_autofollow_to_invites.rb' - - 'db/migrate/20180616192031_add_chosen_languages_to_users.rb' - - 'db/migrate/20180617162849_remove_unused_indexes.rb' - - 'db/migrate/20180628181026_create_custom_filters.rb' - - 'db/migrate/20180707154237_add_whole_word_to_custom_filter.rb' - - 'db/migrate/20180711152640_create_relays.rb' - - 'db/migrate/20180808175627_create_account_pins.rb' - - 'db/migrate/20180812123222_change_relays_enabled.rb' - - 'db/migrate/20180812162710_create_status_stats.rb' - - 'db/migrate/20180812173710_copy_status_stats.rb' - - 'db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb' - - 'db/migrate/20180820232245_add_foreign_key_indices.rb' - - 'db/migrate/20180831171112_create_bookmarks.rb' - - 'db/migrate/20180929222014_create_account_conversations.rb' - - 'db/migrate/20181007025445_create_pghero_space_stats.rb' - - 'db/migrate/20181010141500_add_silent_to_mentions.rb' - - 'db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb' - - 'db/migrate/20181018205649_add_unread_to_account_conversations.rb' - - 'db/migrate/20181024224956_migrate_account_conversations.rb' - - 'db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb' - - 'db/migrate/20181116165755_create_account_stats.rb' - - 'db/migrate/20181116173541_copy_account_stats.rb' - - 'db/migrate/20181127130500_identity_id_to_bigint.rb' - - 'db/migrate/20181127165847_add_show_replies_to_lists.rb' - - 'db/migrate/20181203003808_create_accounts_tags_join_table.rb' - - 'db/migrate/20181203021853_add_discoverable_to_accounts.rb' - - 'db/migrate/20181204193439_add_last_status_at_to_account_stats.rb' - - 'db/migrate/20181204215309_create_account_tag_stats.rb' - - 'db/migrate/20181207011115_downcase_custom_emoji_domains.rb' - - 'db/migrate/20181213184704_create_account_warnings.rb' - - 'db/migrate/20181213185533_create_account_warning_presets.rb' - - 'db/migrate/20181219235220_add_created_by_application_id_to_users.rb' - - 'db/migrate/20181226021420_add_also_known_as_to_accounts.rb' - - 'db/migrate/20190103124649_create_scheduled_statuses.rb' - - 'db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb' - - 'db/migrate/20190117114553_create_tombstones.rb' - - 'db/migrate/20190201012802_add_overwrite_to_imports.rb' - - 'db/migrate/20190203180359_create_featured_tags.rb' - - 'db/migrate/20190225031541_create_polls.rb' - - 'db/migrate/20190225031625_create_poll_votes.rb' - - 'db/migrate/20190226003449_add_poll_id_to_statuses.rb' - - 'db/migrate/20190304152020_add_uri_to_poll_votes.rb' - - 'db/migrate/20190306145741_add_lock_version_to_polls.rb' - - 'db/migrate/20190307234537_add_approved_to_users.rb' - - 'db/migrate/20190314181829_migrate_open_registrations_setting.rb' - - 'db/migrate/20190316190352_create_account_identity_proofs.rb' - - 'db/migrate/20190317135723_add_uri_to_reports.rb' - - 'db/migrate/20190403141604_add_comment_to_invites.rb' - - 'db/migrate/20190409054914_create_user_invite_requests.rb' - - 'db/migrate/20190420025523_add_blurhash_to_media_attachments.rb' - - 'db/migrate/20190509164208_add_by_moderator_to_tombstone.rb' - - 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' - - 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb' - - 'db/migrate/20190627222225_create_custom_emoji_categories.rb' - - 'db/migrate/20190627222826_add_category_id_to_custom_emojis.rb' - - 'db/migrate/20190701022101_add_trust_level_to_accounts.rb' - - 'db/migrate/20190705002136_create_domain_allows.rb' - - 'db/migrate/20190715164535_add_instance_actor.rb' - - 'db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb' - - 'db/migrate/20190729185330_add_score_to_tags.rb' - - 'db/migrate/20190805123746_add_capabilities_to_tags.rb' - - 'db/migrate/20190807135426_add_comments_to_domain_blocks.rb' - - 'db/migrate/20190815225426_add_last_status_at_to_tags.rb' - - 'db/migrate/20190819134503_add_deleted_at_to_statuses.rb' - - 'db/migrate/20190820003045_update_statuses_index.rb' - - 'db/migrate/20190823221802_add_local_index_to_statuses.rb' - - 'db/migrate/20190901035623_add_max_score_to_tags.rb' - - 'db/migrate/20190904222339_create_markers.rb' - - 'db/migrate/20190914202517_create_account_migrations.rb' - - 'db/migrate/20190915194355_create_account_aliases.rb' - - 'db/migrate/20190917213523_add_remember_token_index.rb' - - 'db/migrate/20190927232842_add_voters_count_to_polls.rb' - - 'db/migrate/20191001213028_add_lock_version_to_account_stats.rb' - - 'db/migrate/20191007013357_update_pt_locales.rb' - - 'db/migrate/20191031163205_change_list_account_follow_nullable.rb' - - 'db/migrate/20191212003415_increase_backup_size.rb' - - 'db/migrate/20191212163405_add_hide_collections_to_accounts.rb' - - 'db/migrate/20191218153258_create_announcements.rb' - - 'db/migrate/20200113125135_create_announcement_mutes.rb' - - 'db/migrate/20200114113335_create_announcement_reactions.rb' - - 'db/migrate/20200119112504_add_public_index_to_statuses.rb' - - 'db/migrate/20200126203551_add_published_at_to_announcements.rb' - - 'db/migrate/20200306035625_add_processing_to_media_attachments.rb' - - 'db/migrate/20200309150742_add_forwarded_to_reports.rb' - - 'db/migrate/20200312144258_add_title_to_account_warning_presets.rb' - - 'db/migrate/20200312162302_add_status_ids_to_announcements.rb' - - 'db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb' - - 'db/migrate/20200317021758_add_expires_at_to_mutes.rb' - - 'db/migrate/20200407201300_create_unavailable_domains.rb' - - 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb' - - 'db/migrate/20200417125749_add_storage_schema_version.rb' - - 'db/migrate/20200508212852_reset_unique_jobs_locks.rb' - - 'db/migrate/20200510110808_reset_web_app_secret.rb' - - 'db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb' - - 'db/migrate/20200516180352_create_devices.rb' - - 'db/migrate/20200516183822_create_one_time_keys.rb' - - 'db/migrate/20200518083523_create_encrypted_messages.rb' - - 'db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb' - - 'db/migrate/20200529214050_add_devices_url_to_accounts.rb' - - 'db/migrate/20200601222558_create_system_keys.rb' - - 'db/migrate/20200605155027_add_blurhash_to_preview_cards.rb' - - 'db/migrate/20200608113046_add_sign_in_token_to_users.rb' - - 'db/migrate/20200614002136_add_sensitized_to_accounts.rb' - - 'db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb' - - 'db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb' - - 'db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb' - - 'db/migrate/20200628133322_create_account_notes.rb' - - 'db/migrate/20200630190240_create_webauthn_credentials.rb' - - 'db/migrate/20200630190544_add_webauthn_id_to_users.rb' - - 'db/migrate/20200908193330_create_account_deletion_requests.rb' - - 'db/migrate/20200917192924_add_notify_to_follows.rb' - - 'db/migrate/20200917193034_add_type_to_notifications.rb' - - 'db/migrate/20200917222316_add_index_notifications_on_type.rb' - - 'db/migrate/20201008202037_create_ip_blocks.rb' - - 'db/migrate/20201008220312_add_sign_up_ip_to_users.rb' - - 'db/migrate/20201017233919_add_suspension_origin_to_accounts.rb' - - 'db/migrate/20201206004238_create_instances.rb' - - 'db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb' - - 'db/migrate/20210221045109_create_rules.rb' - - 'db/migrate/20210306164523_account_ids_to_timestamp_ids.rb' - - 'db/migrate/20210322164601_create_account_summaries.rb' - - 'db/migrate/20210323114347_create_follow_recommendations.rb' - - 'db/migrate/20210324171613_create_follow_recommendation_suppressions.rb' - - 'db/migrate/20210416200740_create_canonical_email_blocks.rb' - - 'db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb' - - 'db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb' - - 'db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb' - - 'db/migrate/20210609202149_create_login_activities.rb' - - 'db/migrate/20210616214526_create_user_ips.rb' - - 'db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb' - - 'db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb' - - 'db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb' - - 'db/migrate/20210904215403_add_edited_at_to_statuses.rb' - - 'db/migrate/20210908220918_create_status_edits.rb' - - 'db/migrate/20211031031021_create_preview_card_providers.rb' - - 'db/migrate/20211112011713_add_language_to_preview_cards.rb' - - 'db/migrate/20211115032527_add_trendable_to_preview_cards.rb' - - 'db/migrate/20211123212714_add_link_type_to_preview_cards.rb' - - 'db/migrate/20211213040746_update_account_summaries_to_version_2.rb' - - 'db/migrate/20211231080958_add_category_to_reports.rb' - - 'db/migrate/20220105163928_remove_mentions_status_id_index.rb' - - 'db/migrate/20220115125126_add_report_id_to_account_warnings.rb' - - 'db/migrate/20220115125341_fix_account_warning_actions.rb' - - 'db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb' - - 'db/migrate/20220124141035_create_appeals.rb' - - 'db/migrate/20220202200743_add_trendable_to_accounts.rb' - - 'db/migrate/20220202200926_add_trendable_to_statuses.rb' - - 'db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb' - - 'db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb' - - 'db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb' - - 'db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb' - - 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' - - 'db/migrate/20220304195405_migrate_hide_network_preference.rb' - - 'db/migrate/20220307094650_fix_featured_tags_constraints.rb' - - 'db/migrate/20220309213005_fix_reblog_deleted_at.rb' - - 'db/migrate/20220316233212_update_kurdish_locales.rb' - - 'db/migrate/20220428112511_add_index_statuses_on_account_id.rb' - - 'db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb' - - 'db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb' - - 'db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb' - - 'db/migrate/20220606044941_create_webhooks.rb' - - 'db/migrate/20220611210335_create_user_roles.rb' - - 'db/migrate/20220611212541_add_role_id_to_users.rb' - - 'db/migrate/20220613110628_create_custom_filter_keywords.rb' - - 'db/migrate/20220613110711_migrate_custom_filters.rb' - - 'db/migrate/20220613110834_add_action_to_custom_filters.rb' - - 'db/migrate/20220710102457_add_display_name_to_tags.rb' - - 'db/migrate/20220714171049_create_tag_follows.rb' - - 'db/migrate/20220808101323_create_custom_filter_statuses.rb' - - 'db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb' - - 'db/migrate/20220824233535_create_status_trends.rb' - - 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' - - 'db/migrate/20220829192633_add_languages_to_follows.rb' - - 'db/migrate/20220829192658_add_languages_to_follow_requests.rb' - - 'db/migrate/20221006061337_create_preview_card_trends.rb' - - 'db/migrate/20221012181003_add_blurhash_to_site_uploads.rb' - - 'db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb' - - 'db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb' - - 'db/migrate/20221104133904_add_name_to_featured_tags.rb' - - 'db/post_migrate/20180813113448_copy_status_stats_cleanup.rb' - - 'db/post_migrate/20181116184611_copy_account_stats_cleanup.rb' - - 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb' - - 'db/post_migrate/20190519130537_remove_boosts_widening_audience.rb' - - 'db/post_migrate/20190706233204_drop_stream_entries.rb' - - 'db/post_migrate/20190715031050_drop_subscriptions.rb' - - 'db/post_migrate/20190901040524_remove_score_from_tags.rb' - - 'db/post_migrate/20190927124642_remove_invalid_web_push_subscription.rb' - - 'db/post_migrate/20200917193528_migrate_notifications_type.rb' - - 'db/post_migrate/20200917222734_remove_index_notifications_on_account_activity.rb' - - 'db/post_migrate/20201017234926_fill_account_suspension_origin.rb' - - 'db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb' - - 'db/post_migrate/20210502233513_drop_account_tag_stats.rb' - - 'db/post_migrate/20210507001928_remove_hub_url_from_accounts.rb' - - 'db/post_migrate/20210526193025_remove_lock_version_from_account_stats.rb' - - 'db/post_migrate/20210616214135_remove_current_sign_in_ip_from_users.rb' - - 'db/post_migrate/20210808071221_clear_orphaned_account_notes.rb' - - 'db/post_migrate/20211126000907_drop_account_identity_proofs.rb' - - 'db/post_migrate/20220109213908_remove_action_taken_from_reports.rb' - - 'db/post_migrate/20220118183010_remove_index_users_on_remember_token.rb' - - 'db/post_migrate/20220118183123_remove_rememberable_from_users.rb' - - 'db/post_migrate/20220202201015_remove_trust_level_from_accounts.rb' - - 'db/post_migrate/20220303203437_remove_media_attachments_changed_from_status_edits.rb' - - 'db/post_migrate/20220307083603_optimize_null_index_conversations_uri.rb' - - 'db/post_migrate/20220310060545_optimize_null_index_statuses_in_reply_to_account_id.rb' - - 'db/post_migrate/20220310060556_optimize_null_index_statuses_in_reply_to_id.rb' - - 'db/post_migrate/20220310060614_optimize_null_index_media_attachments_scheduled_status_id.rb' - - 'db/post_migrate/20220310060626_optimize_null_index_media_attachments_shortcode.rb' - - 'db/post_migrate/20220310060641_optimize_null_index_users_reset_password_token.rb' - - 'db/post_migrate/20220310060653_optimize_null_index_users_created_by_application_id.rb' - - 'db/post_migrate/20220310060706_optimize_null_index_statuses_uri.rb' - - 'db/post_migrate/20220310060722_optimize_null_index_accounts_moved_to_account_id.rb' - - 'db/post_migrate/20220310060740_optimize_null_index_oauth_access_tokens_refresh_token.rb' - - 'db/post_migrate/20220310060750_optimize_null_index_accounts_url.rb' - - 'db/post_migrate/20220310060809_optimize_null_index_oauth_access_tokens_resource_owner_id.rb' - - 'db/post_migrate/20220310060833_optimize_null_index_announcement_reactions_custom_emoji_id.rb' - - 'db/post_migrate/20220310060854_optimize_null_index_appeals_approved_by_account_id.rb' - - 'db/post_migrate/20220310060913_optimize_null_index_account_migrations_target_account_id.rb' - - 'db/post_migrate/20220310060926_optimize_null_index_appeals_rejected_by_account_id.rb' - - 'db/post_migrate/20220310060939_optimize_null_index_list_accounts_follow_id.rb' - - 'db/post_migrate/20220310060959_optimize_null_index_web_push_subscriptions_access_token_id.rb' - - 'db/post_migrate/20220429101025_remove_ips_from_email_domain_blocks.rb' - - 'db/post_migrate/20220429101850_clear_email_domain_blocks.rb' - - 'db/post_migrate/20220527114923_remove_filtered_languages_from_users.rb' - - 'db/post_migrate/20220613110802_remove_whole_word_from_custom_filters.rb' - - 'db/post_migrate/20220613110903_remove_irreversible_from_custom_filters.rb' - - 'db/post_migrate/20220617202502_migrate_roles.rb' - - 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb' - - 'db/post_migrate/20220729171123_fix_custom_filter_keywords_id_seq.rb' - - 'db/post_migrate/20220824164532_remove_recorded_changes_from_admin_action_logs.rb' - - 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb' - - 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb' - - 'lib/active_record/batches.rb' - - 'lib/active_record/database_tasks_extensions.rb' - - 'lib/chewy/strategy/mastodon.rb' - - 'lib/cli.rb' - - 'lib/devise/two_factor_ldap_authenticatable.rb' - - 'lib/devise/two_factor_pam_authenticatable.rb' - - 'lib/exceptions.rb' - - 'lib/generators/post_deployment_migration_generator.rb' - - 'lib/mastodon/accounts_cli.rb' - - 'lib/mastodon/cache_cli.rb' - - 'lib/mastodon/canonical_email_blocks_cli.rb' - - 'lib/mastodon/cli_helper.rb' - - 'lib/mastodon/domains_cli.rb' - - 'lib/mastodon/email_domain_blocks_cli.rb' - - 'lib/mastodon/emoji_cli.rb' - - 'lib/mastodon/feeds_cli.rb' - - 'lib/mastodon/ip_blocks_cli.rb' - - 'lib/mastodon/maintenance_cli.rb' - - 'lib/mastodon/media_cli.rb' - - 'lib/mastodon/premailer_webpack_strategy.rb' - - 'lib/mastodon/preview_cards_cli.rb' - - 'lib/mastodon/rack_middleware.rb' - - 'lib/mastodon/search_cli.rb' - - 'lib/mastodon/settings_cli.rb' - - 'lib/mastodon/sidekiq_middleware.rb' - - 'lib/mastodon/snowflake.rb' - - 'lib/mastodon/statuses_cli.rb' - - 'lib/mastodon/upgrade_cli.rb' - - 'lib/mastodon/version.rb' - - 'lib/paperclip/attachment_extensions.rb' - - 'lib/paperclip/blurhash_transcoder.rb' - - 'lib/paperclip/color_extractor.rb' - - 'lib/paperclip/gif_transcoder.rb' - - 'lib/paperclip/image_extractor.rb' - - 'lib/paperclip/lazy_thumbnail.rb' - - 'lib/paperclip/response_with_limit_adapter.rb' - - 'lib/paperclip/type_corrector.rb' - - 'lib/paperclip/url_generator_extensions.rb' - - 'lib/public_file_server_middleware.rb' - - 'lib/rails/engine_extensions.rb' - - 'lib/redis/namespace_extensions.rb' - - 'lib/sanitize_ext/sanitize_config.rb' - - 'lib/simple_navigation/item_extensions.rb' - - 'lib/terrapin/multi_pipe_extensions.rb' - - 'lib/webpacker/helper_extensions.rb' - - 'lib/webpacker/manifest_extensions.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedVars. Style/FetchEnvVar: -- cgit From b22b4bac03182aecdc09e2e6b896ff7ec67d7dd6 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 17 Mar 2023 05:13:28 -0400 Subject: Include config/ and update all rubcop deps (#23963) --- .rubocop.yml | 2 +- .rubocop_todo.yml | 404 +++++++++++++++++++++++++++++++++++++++- Gemfile | 2 + Gemfile.lock | 9 +- app/helpers/languages_helper.rb | 4 +- 5 files changed, 412 insertions(+), 9 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 4f4c98dc9..9e9240636 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,7 @@ require: - rubocop-rails - rubocop-rspec - rubocop-performance + - rubocop-capybara AllCops: TargetRubyVersion: 2.7 @@ -19,7 +20,6 @@ AllCops: NewCops: enable Exclude: - db/schema.rb - - 'config/**/*' - 'bin/*' - 'Rakefile' - 'node_modules/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e41c10e1c..a3536e202 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -13,6 +13,81 @@ Bundler/OrderedGems: Exclude: - 'Gemfile' +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/ArgumentAlignment: + Exclude: + - 'config/initializers/cors.rb' + - 'config/initializers/session_store.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'config/routes.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'config/initializers/omniauth.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'config/boot.rb' + - 'config/environments/production.rb' + - 'config/initializers/rack_attack.rb' + - 'config/routes.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Width, AllowedPatterns. +Layout/IndentationWidth: + Exclude: + - 'config/initializers/ffmpeg.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +Layout/LeadingCommentSpace: + Exclude: + - 'config/application.rb' + - 'config/initializers/omniauth.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'config/initializers/paperclip.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: require_no_space, require_space +Layout/SpaceInLambdaLiteral: + Exclude: + - 'config/environments/production.rb' + - 'config/initializers/content_security_policy.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/SpaceInsideStringInterpolation: + Exclude: + - 'config/initializers/webauthn.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'config/initializers/paperclip.rb' + # Configuration parameters: AllowedMethods, AllowedPatterns. Lint/AmbiguousBlockAssociation: Exclude: @@ -26,6 +101,11 @@ Lint/AmbiguousBlockAssociation: - 'spec/services/unsuspend_account_service_spec.rb' - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'config/initializers/rack_attack.rb' + # Configuration parameters: AllowedMethods. # AllowedMethods: enums Lint/ConstantDefinitionInBlock: @@ -109,9 +189,24 @@ Lint/OrAssignmentToConstant: Exclude: - 'lib/sanitize_ext/sanitize_config.rb' +# This cop supports safe autocorrection (--autocorrect). +Lint/SendWithMixinArgument: + Exclude: + - 'config/application.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'config/initializers/content_security_policy.rb' + - 'config/initializers/doorkeeper.rb' + - 'config/initializers/paperclip.rb' + - 'config/initializers/simple_form.rb' + Lint/UselessAssignment: Exclude: - 'app/services/activitypub/process_status_update_service.rb' + - 'config/initializers/omniauth.rb' - 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' - 'db/post_migrate/20190511152737_remove_suspended_silenced_account_fields.rb' - 'spec/controllers/api/v1/bookmarks_controller_spec.rb' @@ -141,7 +236,7 @@ Metrics/AbcSize: # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. # AllowedMethods: refine Metrics/BlockLength: - Max: 433 + Max: 544 # Configuration parameters: CountBlocks, Max. Metrics/BlockNesting: @@ -185,6 +280,13 @@ Naming/AccessorMethodName: Exclude: - 'app/controllers/auth/sessions_controller.rb' +# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# CheckDefinitionPathHierarchyRoots: lib, spec, test, src +# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS +Naming/FileName: + Exclude: + - 'config/locales/sr-Latn.rb' + # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -195,6 +297,7 @@ Naming/MemoizedInstanceVariableName: - 'app/lib/activitypub/activity.rb' - 'app/services/resolve_url_service.rb' - 'app/services/search_service.rb' + - 'config/initializers/rack_attack.rb' # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer @@ -227,6 +330,7 @@ Performance/CollectionLiteralInLoop: - 'app/services/fetch_resource_service.rb' - 'app/services/suspend_account_service.rb' - 'app/services/unsuspend_account_service.rb' + - 'config/deploy.rb' - 'lib/mastodon/media_cli.rb' # This cop supports unsafe autocorrection (--autocorrect-all). @@ -279,6 +383,12 @@ Performance/RedundantEqualityComparisonBlock: Exclude: - 'spec/requests/link_headers_spec.rb' +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: MaxKeyValuePairs. +Performance/RedundantMerge: + Exclude: + - 'config/initializers/paperclip.rb' + # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SafeMultiline. Performance/StartWith: @@ -679,6 +789,29 @@ RSpec/LetSetup: - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' - 'spec/workers/scheduler/user_cleanup_scheduler_spec.rb' +# This cop supports safe autocorrection (--autocorrect). +RSpec/MatchArray: + Exclude: + - 'spec/controllers/activitypub/followers_synchronizations_controller_spec.rb' + - 'spec/controllers/admin/export_domain_blocks_controller_spec.rb' + - 'spec/controllers/api/v1/accounts/follower_accounts_controller_spec.rb' + - 'spec/controllers/api/v1/accounts/following_accounts_controller_spec.rb' + - 'spec/controllers/api/v1/accounts/statuses_controller_spec.rb' + - 'spec/controllers/api/v1/bookmarks_controller_spec.rb' + - 'spec/controllers/api/v1/favourites_controller_spec.rb' + - 'spec/controllers/api/v1/reports_controller_spec.rb' + - 'spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb' + - 'spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb' + - 'spec/models/account_filter_spec.rb' + - 'spec/models/account_spec.rb' + - 'spec/models/account_statuses_cleanup_policy_spec.rb' + - 'spec/models/custom_emoji_filter_spec.rb' + - 'spec/models/status_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/presenters/familiar_followers_presenter_spec.rb' + - 'spec/services/activitypub/fetch_featured_collection_service_spec.rb' + - 'spec/services/update_status_service_spec.rb' + RSpec/MessageChain: Exclude: - 'spec/controllers/api/v1/media_controller_spec.rb' @@ -962,8 +1095,9 @@ RSpec/NoExpectationExample: RSpec/PendingWithoutReason: Exclude: + - 'spec/controllers/statuses_controller_spec.rb' - 'spec/models/account_spec.rb' - - 'spec/support/examples/lib/settings/scoped_settings.rb' + - 'spec/models/user_spec.rb' # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. @@ -1348,6 +1482,7 @@ Rails/CompactBlank: - 'app/models/poll.rb' - 'app/models/user.rb' - 'app/services/import_service.rb' + - 'config/initializers/paperclip.rb' # This cop supports safe autocorrection (--autocorrect). Rails/ContentTag: @@ -1369,16 +1504,24 @@ Rails/CreateTableWithTimestamps: - 'db/migrate/20221006061337_create_preview_card_trends.rb' # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Severity. Rails/DeprecatedActiveModelErrorsMethods: Exclude: - 'lib/mastodon/accounts_cli.rb' # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity. Rails/DuplicateAssociation: Exclude: - 'app/serializers/activitypub/collection_serializer.rb' - 'app/serializers/activitypub/note_serializer.rb' +# Configuration parameters: Include. +# Include: app/**/*.rb, config/**/*.rb, lib/**/*.rb +Rails/Exit: + Exclude: + - 'config/boot.rb' + # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: @@ -1386,6 +1529,7 @@ Rails/FilePath: - 'app/lib/themes.rb' - 'app/models/setting.rb' - 'app/validators/reaction_validator.rb' + - 'config/environments/test.rb' - 'db/migrate/20170716191202_add_hide_notifications_to_mute.rb' - 'db/migrate/20170918125918_ids_to_bigints.rb' - 'db/migrate/20171005171936_add_disabled_to_custom_emojis.rb' @@ -1558,6 +1702,16 @@ Rails/Output: Exclude: - 'lib/mastodon/ip_blocks_cli.rb' +Rails/OutputSafety: + Exclude: + - 'config/initializers/simple_form.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. +Rails/Present: + Exclude: + - 'config/initializers/content_security_policy.rb' + # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. # Include: **/Rakefile, **/*.rake @@ -1570,6 +1724,15 @@ Rails/RakeEnvironment: - 'lib/tasks/repo.rake' - 'lib/tasks/statistics.rake' +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: spec/controllers/**/*.rb, spec/requests/**/*.rb, test/controllers/**/*.rb, test/integration/**/*.rb +Rails/ResponseParsedBody: + Exclude: + - 'spec/controllers/follower_accounts_controller_spec.rb' + - 'spec/controllers/following_accounts_controller_spec.rb' + - 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb' + # Configuration parameters: Include. # Include: db/**/*.rb Rails/ReversibleMigration: @@ -1718,6 +1881,12 @@ Rails/WhereExists: - 'spec/services/purge_domain_service_spec.rb' - 'spec/services/unallow_domain_service_spec.rb' +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowOnConstant, AllowOnSelfClass. +Style/CaseEquality: + Exclude: + - 'config/initializers/trusted_proxies.rb' + # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: MinBranchesCount. Style/CaseLikeIf: @@ -1732,6 +1901,10 @@ Style/ClassEqualityComparison: - 'app/helpers/jsonld_helper.rb' - 'app/serializers/activitypub/outbox_serializer.rb' +Style/ClassVars: + Exclude: + - 'config/initializers/devise.rb' + Style/CombinableLoops: Exclude: - 'app/models/form/custom_emoji_batch.rb' @@ -1749,6 +1922,16 @@ Style/FetchEnvVar: - 'app/helpers/application_helper.rb' - 'app/lib/redis_configuration.rb' - 'app/lib/translation_service.rb' + - 'config/environments/development.rb' + - 'config/environments/production.rb' + - 'config/initializers/2_whitelist_mode.rb' + - 'config/initializers/blacklists.rb' + - 'config/initializers/cache_buster.rb' + - 'config/initializers/content_security_policy.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/omniauth.rb' + - 'config/initializers/paperclip.rb' + - 'config/initializers/vapid.rb' - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/mastodon/redis_config.rb' - 'lib/tasks/repo.rake' @@ -1757,9 +1940,11 @@ Style/FetchEnvVar: # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. # SupportedStyles: annotated, template, unannotated +# AllowedMethods: redirect Style/FormatStringToken: Exclude: - 'app/models/privacy_policy.rb' + - 'config/initializers/devise.rb' - 'lib/mastodon/maintenance_cli.rb' - 'lib/paperclip/color_extractor.rb' @@ -1771,6 +1956,52 @@ Style/FrozenStringLiteralComment: - 'app/views/accounts/show.rss.ruby' - 'app/views/tags/show.rss.ruby' - 'app/views/well_known/host_meta/show.xml.ruby' + - 'config/application.rb' + - 'config/boot.rb' + - 'config/environment.rb' + - 'config/environments/development.rb' + - 'config/environments/production.rb' + - 'config/environments/test.rb' + - 'config/initializers/0_post_deployment_migrations.rb' + - 'config/initializers/active_model_serializers.rb' + - 'config/initializers/application_controller_renderer.rb' + - 'config/initializers/assets.rb' + - 'config/initializers/backtrace_silencers.rb' + - 'config/initializers/cache_logging.rb' + - 'config/initializers/chewy.rb' + - 'config/initializers/content_security_policy.rb' + - 'config/initializers/cookies_serializer.rb' + - 'config/initializers/cors.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/doorkeeper.rb' + - 'config/initializers/fast_blank.rb' + - 'config/initializers/ffmpeg.rb' + - 'config/initializers/filter_parameter_logging.rb' + - 'config/initializers/http_client_proxy.rb' + - 'config/initializers/httplog.rb' + - 'config/initializers/inflections.rb' + - 'config/initializers/mail_delivery_job.rb' + - 'config/initializers/makara.rb' + - 'config/initializers/mime_types.rb' + - 'config/initializers/oj.rb' + - 'config/initializers/omniauth.rb' + - 'config/initializers/open_uri_redirection.rb' + - 'config/initializers/permissions_policy.rb' + - 'config/initializers/pghero.rb' + - 'config/initializers/preload_link_headers.rb' + - 'config/initializers/premailer_rails.rb' + - 'config/initializers/rack_attack_logging.rb' + - 'config/initializers/redis.rb' + - 'config/initializers/session_store.rb' + - 'config/initializers/simple_form.rb' + - 'config/initializers/stoplight.rb' + - 'config/initializers/trusted_proxies.rb' + - 'config/initializers/twitter_regex.rb' + - 'config/initializers/webauthn.rb' + - 'config/initializers/wrap_parameters.rb' + - 'config/locales/sr-Latn.rb' + - 'config/locales/sr.rb' + - 'config/puma.rb' - 'db/migrate/20160220174730_create_accounts.rb' - 'db/migrate/20160220211917_create_statuses.rb' - 'db/migrate/20160221003140_create_users.rb' @@ -2117,6 +2348,18 @@ Style/FrozenStringLiteralComment: - 'lib/tasks/branding.rake' - 'spec/fabricators_spec.rb' +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/GlobalStdStream: + Exclude: + - 'config/boot.rb' + - 'config/environments/development.rb' + - 'config/environments/production.rb' + +# Configuration parameters: AllowedVariables. +Style/GlobalVars: + Exclude: + - 'config/initializers/statsd.rb' + # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: @@ -2143,6 +2386,7 @@ Style/GuardClause: - 'app/workers/redownload_header_worker.rb' - 'app/workers/redownload_media_worker.rb' - 'app/workers/remote_account_refresh_worker.rb' + - 'config/initializers/devise.rb' - 'db/migrate/20170901141119_truncate_preview_cards.rb' - 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb' - 'lib/devise/two_factor_ldap_authenticatable.rb' @@ -2187,14 +2431,48 @@ Style/HashTransformValues: - 'app/serializers/rest/web_push_subscription_serializer.rb' - 'app/services/import_service.rb' +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/IdenticalConditionalBranches: + Exclude: + - 'config/initializers/content_security_policy.rb' + +# This cop supports safe autocorrection (--autocorrect). +Style/IfUnlessModifier: + Exclude: + - 'config/environments/production.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/ffmpeg.rb' + # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: InverseMethods, InverseBlocks. Style/InverseMethods: Exclude: + - 'app/controllers/concerns/signature_verification.rb' + - 'app/helpers/jsonld_helper.rb' + - 'app/lib/activitypub/activity/create.rb' + - 'app/lib/activitypub/activity/move.rb' + - 'app/lib/feed_manager.rb' + - 'app/lib/link_details_extractor.rb' + - 'app/models/concerns/attachmentable.rb' + - 'app/models/concerns/remotable.rb' - 'app/models/custom_filter.rb' + - 'app/models/webhook.rb' + - 'app/services/activitypub/process_status_update_service.rb' + - 'app/services/fetch_link_card_service.rb' + - 'app/services/search_service.rb' - 'app/services/update_account_service.rb' + - 'app/workers/web/push_notification_worker.rb' + - 'lib/paperclip/color_extractor.rb' - 'spec/controllers/activitypub/replies_controller_spec.rb' +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: line_count_dependent, lambda, literal +Style/Lambda: + Exclude: + - 'config/initializers/simple_form.rb' + - 'config/routes.rb' + # This cop supports unsafe autocorrection (--autocorrect-all). Style/MapToHash: Exclude: @@ -2213,9 +2491,21 @@ Style/MutableConstant: - 'app/services/delete_account_service.rb' - 'app/services/fetch_link_card_service.rb' - 'app/services/resolve_url_service.rb' + - 'config/initializers/twitter_regex.rb' - 'lib/mastodon/snowflake.rb' - 'spec/controllers/api/base_controller_spec.rb' +# This cop supports safe autocorrection (--autocorrect). +Style/NilLambda: + Exclude: + - 'config/initializers/paperclip.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinDigits, Strict, AllowedNumbers, AllowedPatterns. +Style/NumericLiterals: + Exclude: + - 'config/initializers/strong_migrations.rb' + # Configuration parameters: AllowedMethods. # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: @@ -2231,6 +2521,44 @@ Style/OptionalBooleanParameter: - 'app/workers/unfollow_follow_worker.rb' - 'lib/mastodon/redis_config.rb' +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'config/deploy.rb' + - 'config/initializers/doorkeeper.rb' + +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: short, verbose +Style/PreferredHashMethods: + Exclude: + - 'config/initializers/paperclip.rb' + +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantBegin: + Exclude: + - 'config/initializers/simple_form.rb' + +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantConstantBase: + Exclude: + - 'config/environments/production.rb' + - 'config/initializers/sidekiq.rb' + - 'config/initializers/statsd.rb' + - 'config/locales/sr-Latn.rb' + - 'config/locales/sr.rb' + +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SafeForConstants. +Style/RedundantFetchBlock: + Exclude: + - 'config/initializers/1_hosts.rb' + - 'config/initializers/chewy.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/paperclip.rb' + - 'config/puma.rb' + # This cop supports safe autocorrection (--autocorrect). Style/RedundantRegexpCharacterClass: Exclude: @@ -2239,6 +2567,7 @@ Style/RedundantRegexpCharacterClass: - 'app/models/domain_allow.rb' - 'app/models/domain_block.rb' - 'app/services/fetch_oembed_service.rb' + - 'config/initializers/rack_attack.rb' - 'lib/tasks/emojis.rake' - 'lib/tasks/mastodon.rake' @@ -2249,6 +2578,7 @@ Style/RedundantRegexpEscape: - 'app/models/account.rb' - 'app/models/tag.rb' - 'app/services/fetch_link_card_service.rb' + - 'config/initializers/twitter_regex.rb' - 'lib/paperclip/color_extractor.rb' - 'lib/tasks/mastodon.rake' @@ -2270,6 +2600,9 @@ Style/RegexpLiteral: - 'app/services/backup_service.rb' - 'app/services/fetch_oembed_service.rb' - 'app/services/search_service.rb' + - 'config/initializers/rack_attack.rb' + - 'config/initializers/twitter_regex.rb' + - 'config/routes.rb' - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/tasks/mastodon.rake' @@ -2317,6 +2650,73 @@ Style/SlicingWithRange: - 'lib/mastodon/premailer_webpack_strategy.rb' - 'lib/tasks/repo.rake' +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: require_parentheses, require_no_parentheses +Style/StabbyLambdaParentheses: + Exclude: + - 'config/environments/production.rb' + - 'config/initializers/content_security_policy.rb' + +# This cop supports safe autocorrection (--autocorrect). +Style/StderrPuts: + Exclude: + - 'config/boot.rb' + +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'config/initializers/paperclip.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Exclude: + - 'config/environments/production.rb' + - 'config/initializers/backtrace_silencers.rb' + - 'config/initializers/http_client_proxy.rb' + - 'config/initializers/rack_attack.rb' + - 'config/initializers/webauthn.rb' + - 'config/routes.rb' + +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method, mail, respond_to +Style/SymbolProc: + Exclude: + - 'config/initializers/omniauth.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowSafeAssignment. +# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex +Style/TernaryParentheses: + Exclude: + - 'config/environments/development.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArguments: + Exclude: + - 'config/initializers/paperclip.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'config/environments/production.rb' + - 'config/environments/test.rb' + +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + EnforcedStyle: percent + MinSize: 6 + # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https diff --git a/Gemfile b/Gemfile index e5353a08c..b5669582b 100644 --- a/Gemfile +++ b/Gemfile @@ -105,6 +105,8 @@ group :development, :test do gem 'i18n-tasks', '~> 1.0', require: false gem 'rspec-rails', '~> 6.0' gem 'rspec_chunked', '~> 0.6' + + gem 'rubocop-capybara', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false gem 'rubocop-rspec', require: false diff --git a/Gemfile.lock b/Gemfile.lock index c7e1d1750..8b16b9308 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -613,19 +613,19 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.27.0) parser (>= 3.2.1.0) - rubocop-capybara (2.17.0) + rubocop-capybara (2.17.1) rubocop (~> 1.41) rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.4) + rubocop-rails (2.18.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.18.1) + rubocop-rspec (2.19.0) rubocop (~> 1.33) rubocop-capybara (~> 2.17) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby-saml (1.13.0) nokogiri (>= 1.10.5) rexml @@ -864,6 +864,7 @@ DEPENDENCIES rspec_chunked (~> 0.6) rspec_junit_formatter (~> 0.6) rubocop + rubocop-capybara rubocop-performance rubocop-rails rubocop-rspec diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb index 584394758..bbf0a97fc 100644 --- a/app/helpers/languages_helper.rb +++ b/app/helpers/languages_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# rubocop:disable Metrics/ModuleLength, Style/WordArray +# rubocop:disable Metrics/ModuleLength module LanguagesHelper ISO_639_1 = { @@ -275,4 +275,4 @@ module LanguagesHelper end end -# rubocop:enable Metrics/ModuleLength, Style/WordArray +# rubocop:enable Metrics/ModuleLength -- cgit From 503022d6f9c6a63ff005b048d56ea0efbaec2cdc Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 23 Mar 2023 18:19:41 -0400 Subject: Exclude files for Rubocop Metrics/ClassLength (#24213) --- .rubocop.yml | 41 ++++++++++++++++++++++++++++++++++++++++- .rubocop_todo.yml | 4 ---- 2 files changed, 40 insertions(+), 5 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 9e9240636..1033db92d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -59,10 +59,49 @@ Metrics/BlockNesting: Exclude: - 'lib/mastodon/*_cli.rb' +# Reason: Some Excluded files would be candidates for refactoring but not currently addressed +# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength Metrics/ClassLength: - CountAsOne: [array, heredoc] + CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] Exclude: - 'lib/mastodon/*_cli.rb' + - 'app/controllers/admin/accounts_controller.rb' + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/api/v1/admin/accounts_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/auth/registrations_controller.rb' + - 'app/controllers/auth/sessions_controller.rb' + - 'app/lib/activitypub/activity.rb' + - 'app/lib/activitypub/activity/create.rb' + - 'app/lib/activitypub/tag_manager.rb' + - 'app/lib/feed_manager.rb' + - 'app/lib/link_details_extractor.rb' + - 'app/lib/request.rb' + - 'app/lib/text_formatter.rb' + - 'app/lib/user_settings_decorator.rb' + - 'app/mailers/user_mailer.rb' + - 'app/models/account.rb' + - 'app/models/admin/account_action.rb' + - 'app/models/form/account_batch.rb' + - 'app/models/media_attachment.rb' + - 'app/models/status.rb' + - 'app/models/tag.rb' + - 'app/models/user.rb' + - 'app/serializers/activitypub/actor_serializer.rb' + - 'app/serializers/activitypub/note_serializer.rb' + - 'app/serializers/rest/status_serializer.rb' + - 'app/services/account_search_service.rb' + - 'app/services/activitypub/process_account_service.rb' + - 'app/services/activitypub/process_status_update_service.rb' + - 'app/services/backup_service.rb' + - 'app/services/delete_account_service.rb' + - 'app/services/fan_out_on_write_service.rb' + - 'app/services/fetch_link_card_service.rb' + - 'app/services/import_service.rb' + - 'app/services/notify_service.rb' + - 'app/services/post_status_service.rb' + - 'app/services/update_status_service.rb' + - 'lib/paperclip/color_extractor.rb' Metrics/CyclomaticComplexity: Exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3b4ff3597..64a6b6b33 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -243,10 +243,6 @@ Metrics/BlockNesting: Exclude: - 'lib/tasks/mastodon.rake' -# Configuration parameters: CountComments, CountAsOne. -Metrics/ClassLength: - Max: 375 - # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: Max: 25 -- cgit From a9b5598c97fc4d3302b61b260097ef41c2ebe377 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 30 Mar 2023 14:44:00 +0200 Subject: Change user settings to be stored in a more optimal way (#23630) Co-authored-by: Claire --- .rubocop.yml | 8 ++ .rubocop_todo.yml | 1 + .../api/v1/accounts/credentials_controller.rb | 12 +- app/controllers/settings/preferences_controller.rb | 40 +----- app/lib/user_settings_decorator.rb | 155 --------------------- app/lib/user_settings_serializer.rb | 19 +++ app/models/concerns/has_user_settings.rb | 141 +++++++++++++++++++ app/models/user.rb | 59 +------- app/models/user_settings.rb | 99 +++++++++++++ app/models/user_settings/dsl.rb | 37 +++++ app/models/user_settings/glue.rb | 23 +++ app/models/user_settings/namespace.rb | 21 +++ app/models/user_settings/setting.rb | 48 +++++++ app/services/notify_service.rb | 13 +- .../settings/preferences/appearance/show.html.haml | 65 ++++----- .../preferences/notifications/show.html.haml | 36 ++--- .../settings/preferences/other/show.html.haml | 29 ++-- config/initializers/inflections.rb | 1 + config/settings.yml | 34 ----- db/migrate/20230215074327_add_settings_to_users.rb | 7 + db/migrate/20230215074423_move_user_settings.rb | 84 +++++++++++ db/schema.rb | 3 +- lib/tasks/tests.rake | 2 +- .../api/v1/accounts/credentials_controller_spec.rb | 1 + spec/controllers/application_controller_spec.rb | 10 +- .../preferences/notifications_controller_spec.rb | 14 +- .../settings/preferences/other_controller_spec.rb | 14 +- spec/lib/settings/extend_spec.rb | 16 --- spec/lib/settings/scoped_settings_spec.rb | 35 ----- spec/lib/user_settings_decorator_spec.rb | 84 ----------- spec/models/user_settings/namespace_spec.rb | 25 ++++ spec/models/user_settings/setting_spec.rb | 74 ++++++++++ spec/models/user_settings_spec.rb | 110 +++++++++++++++ spec/models/user_spec.rb | 14 +- spec/services/notify_service_spec.rb | 7 +- spec/services/report_service_spec.rb | 3 +- 36 files changed, 818 insertions(+), 526 deletions(-) delete mode 100644 app/lib/user_settings_decorator.rb create mode 100644 app/lib/user_settings_serializer.rb create mode 100644 app/models/concerns/has_user_settings.rb create mode 100644 app/models/user_settings.rb create mode 100644 app/models/user_settings/dsl.rb create mode 100644 app/models/user_settings/glue.rb create mode 100644 app/models/user_settings/namespace.rb create mode 100644 app/models/user_settings/setting.rb create mode 100644 db/migrate/20230215074327_add_settings_to_users.rb create mode 100644 db/migrate/20230215074423_move_user_settings.rb delete mode 100644 spec/lib/settings/extend_spec.rb delete mode 100644 spec/lib/settings/scoped_settings_spec.rb delete mode 100644 spec/lib/user_settings_decorator_spec.rb create mode 100644 spec/models/user_settings/namespace_spec.rb create mode 100644 spec/models/user_settings/setting_spec.rb create mode 100644 spec/models/user_settings_spec.rb (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 1033db92d..b5598b65a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -185,3 +185,11 @@ Style/TrailingCommaInHashLiteral: Style/SymbolArray: Enabled: false + +# Reason: Prefer less intendation in conditional assignments +# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantbegin +Style/RedundantBegin: + Enabled: false + +RSpec/NamedSubject: + EnforcedStyle: named_only diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 64a6b6b33..4ad266c8c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -259,6 +259,7 @@ Metrics/ModuleLength: - 'app/helpers/jsonld_helper.rb' - 'app/helpers/statuses_helper.rb' - 'app/models/concerns/account_interactions.rb' + - 'app/models/concerns/has_user_settings.rb' # Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters. Metrics/ParameterLists: diff --git a/app/controllers/api/v1/accounts/credentials_controller.rb b/app/controllers/api/v1/accounts/credentials_controller.rb index 94b707771..7c7d70fd3 100644 --- a/app/controllers/api/v1/accounts/credentials_controller.rb +++ b/app/controllers/api/v1/accounts/credentials_controller.rb @@ -13,7 +13,7 @@ class Api::V1::Accounts::CredentialsController < Api::BaseController def update @account = current_account UpdateAccountService.new.call(@account, account_params, raise_error: true) - UserSettingsDecorator.new(current_user).update(user_settings_params) if user_settings_params + current_user.update(user_params) if user_params ActivityPub::UpdateDistributionWorker.perform_async(@account.id) render json: @account, serializer: REST::CredentialAccountSerializer end @@ -34,15 +34,17 @@ class Api::V1::Accounts::CredentialsController < Api::BaseController ) end - def user_settings_params + def user_params return nil if params[:source].blank? source_params = params.require(:source) { - 'setting_default_privacy' => source_params.fetch(:privacy, @account.user.setting_default_privacy), - 'setting_default_sensitive' => source_params.fetch(:sensitive, @account.user.setting_default_sensitive), - 'setting_default_language' => source_params.fetch(:language, @account.user.setting_default_language), + settings_attributes: { + default_privacy: source_params.fetch(:privacy, @account.user.setting_default_privacy), + default_sensitive: source_params.fetch(:sensitive, @account.user.setting_default_sensitive), + default_language: source_params.fetch(:language, @account.user.setting_default_language), + }, } end end diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index f5d5c1244..281deb64d 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -4,8 +4,6 @@ class Settings::PreferencesController < Settings::BaseController def show; end def update - user_settings.update(user_settings_params.to_h) - if current_user.update(user_params) I18n.locale = current_user.locale redirect_to after_update_redirect_path, notice: I18n.t('generic.changes_saved_msg') @@ -20,43 +18,7 @@ class Settings::PreferencesController < Settings::BaseController settings_preferences_path end - def user_settings - UserSettingsDecorator.new(current_user) - end - def user_params - params.require(:user).permit( - :locale, - chosen_languages: [] - ) - end - - def user_settings_params - params.require(:user).permit( - :setting_default_privacy, - :setting_default_sensitive, - :setting_default_language, - :setting_unfollow_modal, - :setting_boost_modal, - :setting_delete_modal, - :setting_auto_play_gif, - :setting_display_media, - :setting_expand_spoilers, - :setting_reduce_motion, - :setting_disable_swiping, - :setting_system_font_ui, - :setting_noindex, - :setting_theme, - :setting_aggregate_reblogs, - :setting_show_application, - :setting_advanced_layout, - :setting_use_blurhash, - :setting_use_pending_items, - :setting_trends, - :setting_crop_images, - :setting_always_send_emails, - notification_emails: %i(follow follow_request reblog favourite mention report pending_account trending_tag appeal), - interactions: %i(must_be_follower must_be_following must_be_following_dm) - ) + params.require(:user).permit(:locale, chosen_languages: [], settings_attributes: UserSettings.keys) end end diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb deleted file mode 100644 index 5fb7655a9..000000000 --- a/app/lib/user_settings_decorator.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -class UserSettingsDecorator - attr_reader :user, :settings - - def initialize(user) - @user = user - end - - def update(settings) - @settings = settings - process_update - end - - private - - def process_update - user.settings['notification_emails'] = merged_notification_emails if change?('notification_emails') - user.settings['interactions'] = merged_interactions if change?('interactions') - user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy') - user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive') - user.settings['default_language'] = default_language_preference if change?('setting_default_language') - user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal') - user.settings['boost_modal'] = boost_modal_preference if change?('setting_boost_modal') - user.settings['delete_modal'] = delete_modal_preference if change?('setting_delete_modal') - user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') - user.settings['display_media'] = display_media_preference if change?('setting_display_media') - user.settings['expand_spoilers'] = expand_spoilers_preference if change?('setting_expand_spoilers') - user.settings['reduce_motion'] = reduce_motion_preference if change?('setting_reduce_motion') - user.settings['disable_swiping'] = disable_swiping_preference if change?('setting_disable_swiping') - user.settings['system_font_ui'] = system_font_ui_preference if change?('setting_system_font_ui') - user.settings['noindex'] = noindex_preference if change?('setting_noindex') - user.settings['theme'] = theme_preference if change?('setting_theme') - user.settings['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs') - user.settings['show_application'] = show_application_preference if change?('setting_show_application') - user.settings['advanced_layout'] = advanced_layout_preference if change?('setting_advanced_layout') - user.settings['use_blurhash'] = use_blurhash_preference if change?('setting_use_blurhash') - user.settings['use_pending_items'] = use_pending_items_preference if change?('setting_use_pending_items') - user.settings['trends'] = trends_preference if change?('setting_trends') - user.settings['crop_images'] = crop_images_preference if change?('setting_crop_images') - user.settings['always_send_emails'] = always_send_emails_preference if change?('setting_always_send_emails') - end - - def merged_notification_emails - user.settings['notification_emails'].merge coerced_settings('notification_emails').to_h - end - - def merged_interactions - user.settings['interactions'].merge coerced_settings('interactions').to_h - end - - def default_privacy_preference - settings['setting_default_privacy'] - end - - def default_sensitive_preference - boolean_cast_setting 'setting_default_sensitive' - end - - def unfollow_modal_preference - boolean_cast_setting 'setting_unfollow_modal' - end - - def boost_modal_preference - boolean_cast_setting 'setting_boost_modal' - end - - def delete_modal_preference - boolean_cast_setting 'setting_delete_modal' - end - - def system_font_ui_preference - boolean_cast_setting 'setting_system_font_ui' - end - - def auto_play_gif_preference - boolean_cast_setting 'setting_auto_play_gif' - end - - def display_media_preference - settings['setting_display_media'] - end - - def expand_spoilers_preference - boolean_cast_setting 'setting_expand_spoilers' - end - - def reduce_motion_preference - boolean_cast_setting 'setting_reduce_motion' - end - - def disable_swiping_preference - boolean_cast_setting 'setting_disable_swiping' - end - - def noindex_preference - boolean_cast_setting 'setting_noindex' - end - - def show_application_preference - boolean_cast_setting 'setting_show_application' - end - - def theme_preference - settings['setting_theme'] - end - - def default_language_preference - settings['setting_default_language'] - end - - def aggregate_reblogs_preference - boolean_cast_setting 'setting_aggregate_reblogs' - end - - def advanced_layout_preference - boolean_cast_setting 'setting_advanced_layout' - end - - def use_blurhash_preference - boolean_cast_setting 'setting_use_blurhash' - end - - def use_pending_items_preference - boolean_cast_setting 'setting_use_pending_items' - end - - def trends_preference - boolean_cast_setting 'setting_trends' - end - - def crop_images_preference - boolean_cast_setting 'setting_crop_images' - end - - def always_send_emails_preference - boolean_cast_setting 'setting_always_send_emails' - end - - def boolean_cast_setting(key) - ActiveModel::Type::Boolean.new.cast(settings[key]) - end - - def coerced_settings(key) - coerce_values settings.fetch(key, {}) - end - - def coerce_values(params_hash) - params_hash.transform_values { |x| ActiveModel::Type::Boolean.new.cast(x) } - end - - def change?(key) - !settings[key].nil? - end -end diff --git a/app/lib/user_settings_serializer.rb b/app/lib/user_settings_serializer.rb new file mode 100644 index 000000000..10d1be04d --- /dev/null +++ b/app/lib/user_settings_serializer.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class UserSettingsSerializer + def self.load(value) + json = begin + if value.blank? + {} + else + Oj.load(value, symbol_keys: true) + end + end + + UserSettings.new(json) + end + + def self.dump(value) + Oj.dump(value.as_json) + end +end diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/has_user_settings.rb new file mode 100644 index 000000000..b3fa1f683 --- /dev/null +++ b/app/models/concerns/has_user_settings.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module HasUserSettings + extend ActiveSupport::Concern + + included do + serialize :settings, UserSettingsSerializer + end + + def settings_attributes=(attributes) + settings.update(attributes) + end + + def prefers_noindex? + settings['noindex'] + end + + def preferred_posting_language + valid_locale_cascade(settings['default_language'], locale, I18n.locale) + end + + def setting_auto_play_gif + settings['web.auto_play'] + end + + def setting_default_sensitive + settings['default_sensitive'] + end + + def setting_unfollow_modal + settings['web.unfollow_modal'] + end + + def setting_boost_modal + settings['web.reblog_modal'] + end + + def setting_delete_modal + settings['web.delete_modal'] + end + + def setting_reduce_motion + settings['web.reduce_motion'] + end + + def setting_system_font_ui + settings['web.use_system_font'] + end + + def setting_noindex + settings['noindex'] + end + + def setting_theme + settings['theme'] + end + + def setting_display_media + settings['web.display_media'] + end + + def setting_expand_spoilers + settings['web.expand_content_warnings'] + end + + def setting_default_language + settings['default_language'] + end + + def setting_aggregate_reblogs + settings['aggregate_reblogs'] + end + + def setting_show_application + settings['show_application'] + end + + def setting_advanced_layout + settings['web.advanced_layout'] + end + + def setting_use_blurhash + settings['web.use_blurhash'] + end + + def setting_use_pending_items + settings['web.use_pending_items'] + end + + def setting_trends + settings['web.trends'] + end + + def setting_crop_images + settings['web.crop_images'] + end + + def setting_disable_swiping + settings['web.disable_swiping'] + end + + def setting_always_send_emails + settings['always_send_emails'] + end + + def setting_default_privacy + settings['default_privacy'] || (account.locked? ? 'private' : 'public') + end + + def allows_report_emails? + settings['notification_emails.report'] + end + + def allows_pending_account_emails? + settings['notification_emails.pending_account'] + end + + def allows_appeal_emails? + settings['notification_emails.appeal'] + end + + def allows_trends_review_emails? + settings['notification_emails.trends'] + end + + def aggregates_reblogs? + settings['aggregate_reblogs'] + end + + def shows_application? + settings['show_application'] + end + + def show_all_media? + settings['web.display_media'] == 'show_all' + end + + def hide_all_media? + settings['web.display_media'] == 'hide_all' + end +end diff --git a/app/models/user.rb b/app/models/user.rb index d56a9b9ca..9b225d75f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -39,10 +39,11 @@ # webauthn_id :string # sign_up_ip :inet # role_id :bigint(8) +# settings :text # class User < ApplicationRecord - self.ignored_columns = %w( + self.ignored_columns += %w( remember_created_at remember_token current_sign_in_ip @@ -51,9 +52,9 @@ class User < ApplicationRecord filtered_languages ) - include Settings::Extend include Redisable include LanguagesHelper + include HasUserSettings # The home and list feeds will be stored in Redis for this amount # of time, and status fan-out to followers will include only people @@ -132,13 +133,6 @@ class User < ApplicationRecord has_many :session_activations, dependent: :destroy - delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, - :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, - :expand_spoilers, :default_language, :aggregate_reblogs, :show_application, - :advanced_layout, :use_blurhash, :use_pending_items, :trends, :crop_images, - :disable_swiping, :always_send_emails, - to: :settings, prefix: :setting, allow_nil: false - delegate :can?, to: :role attr_reader :invite_code @@ -302,42 +296,6 @@ class User < ApplicationRecord save! end - def prefers_noindex? - setting_noindex - end - - def preferred_posting_language - valid_locale_cascade(settings.default_language, locale, I18n.locale) - end - - def setting_default_privacy - settings.default_privacy || (account.locked? ? 'private' : 'public') - end - - def allows_report_emails? - settings.notification_emails['report'] - end - - def allows_pending_account_emails? - settings.notification_emails['pending_account'] - end - - def allows_appeal_emails? - settings.notification_emails['appeal'] - end - - def allows_trends_review_emails? - settings.notification_emails['trending_tag'] - end - - def aggregates_reblogs? - @aggregates_reblogs ||= settings.aggregate_reblogs - end - - def shows_application? - @shows_application ||= settings.show_application - end - def token_for_app(app) return nil if app.nil? || app.owner != self @@ -417,14 +375,6 @@ class User < ApplicationRecord send_reset_password_instructions end - def show_all_media? - setting_display_media == 'show_all' - end - - def hide_all_media? - setting_display_media == 'hide_all' - end - protected def send_devise_notification(notification, *args, **kwargs) @@ -494,7 +444,8 @@ class User < ApplicationRecord def sanitize_languages return if chosen_languages.nil? - chosen_languages.reject!(&:blank?) + chosen_languages.compact_blank! + self.chosen_languages = nil if chosen_languages.empty? end diff --git a/app/models/user_settings.rb b/app/models/user_settings.rb new file mode 100644 index 000000000..2c025d6c5 --- /dev/null +++ b/app/models/user_settings.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +class UserSettings + class Error < StandardError; end + class KeyError < Error; end + + include UserSettings::DSL + include UserSettings::Glue + + setting :always_send_emails, default: false + setting :aggregate_reblogs, default: true + setting :theme, default: -> { ::Setting.theme } + setting :noindex, default: -> { ::Setting.noindex } + setting :show_application, default: true + setting :default_language, default: nil + setting :default_sensitive, default: false + setting :default_privacy, default: nil + + namespace :web do + setting :crop_images, default: true + setting :advanced_layout, default: false + setting :trends, default: true + setting :use_blurhash, default: true + setting :use_pending_items, default: false + setting :use_system_font, default: false + setting :disable_swiping, default: false + setting :delete_modal, default: true + setting :reblog_modal, default: false + setting :unfollow_modal, default: true + setting :reduce_motion, default: false + setting :expand_content_warnings, default: false + setting :display_media, default: 'default', in: %w(default show_all hide_all) + setting :auto_play, default: false + end + + namespace :notification_emails do + setting :follow, default: true + setting :reblog, default: false + setting :favourite, default: false + setting :mention, default: true + setting :follow_request, default: true + setting :report, default: true + setting :pending_account, default: true + setting :trends, default: true + setting :appeal, default: true + end + + namespace :interactions do + setting :must_be_follower, default: false + setting :must_be_following, default: false + setting :must_be_following_dm, default: false + end + + def initialize(original_hash) + @original_hash = original_hash || {} + end + + def [](key) + key = key.to_sym + + raise KeyError, "Undefined setting: #{key}" unless self.class.definition_for?(key) + + if @original_hash.key?(key) + @original_hash[key] + else + self.class.definition_for(key).default_value + end + end + + def []=(key, value) + key = key.to_sym + + raise KeyError, "Undefined setting: #{key}" unless self.class.definition_for?(key) + + typecast_value = self.class.definition_for(key).type_cast(value) + + if typecast_value.nil? + @original_hash.delete(key) + else + @original_hash[key] = typecast_value + end + end + + def update(params) + params.each do |k, v| + self[k] = v unless v.nil? + end + end + + keys.each do |key| + define_method(key) do + self[key] + end + end + + def as_json + @original_hash + end +end diff --git a/app/models/user_settings/dsl.rb b/app/models/user_settings/dsl.rb new file mode 100644 index 000000000..26238bbbe --- /dev/null +++ b/app/models/user_settings/dsl.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module UserSettings::DSL + module ClassMethods + def setting(key, options = {}) + @definitions ||= {} + + UserSettings::Setting.new(key, options).tap do |s| + @definitions[s.key] = s + end + end + + def namespace(key, &block) + @definitions ||= {} + + UserSettings::Namespace.new(key).configure(&block).tap do |n| + @definitions.merge!(n.definitions) + end + end + + def keys + @definitions.keys + end + + def definition_for(key) + @definitions[key.to_sym] + end + + def definition_for?(key) + @definitions.key?(key.to_sym) + end + end + + def self.included(base) + base.extend ClassMethods + end +end diff --git a/app/models/user_settings/glue.rb b/app/models/user_settings/glue.rb new file mode 100644 index 000000000..02066a411 --- /dev/null +++ b/app/models/user_settings/glue.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module UserSettings::Glue + def to_model + self + end + + def to_key + '' + end + + def persisted? + false + end + + def type_for_attribute(key) + self.class.definition_for(key)&.type + end + + def has_attribute?(key) # rubocop:disable Naming/PredicateName + self.class.definition_for?(key) + end +end diff --git a/app/models/user_settings/namespace.rb b/app/models/user_settings/namespace.rb new file mode 100644 index 000000000..b8f7e092e --- /dev/null +++ b/app/models/user_settings/namespace.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class UserSettings::Namespace + attr_reader :name, :definitions + + def initialize(name) + @name = name.to_sym + @definitions = {} + end + + def configure(&block) + instance_eval(&block) + self + end + + def setting(key, options = {}) + UserSettings::Setting.new(key, options.merge(namespace: name)).tap do |s| + @definitions[s.key] = s + end + end +end diff --git a/app/models/user_settings/setting.rb b/app/models/user_settings/setting.rb new file mode 100644 index 000000000..c359c593b --- /dev/null +++ b/app/models/user_settings/setting.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +class UserSettings::Setting + attr_reader :name, :namespace, :in + + def initialize(name, options = {}) + @name = name.to_sym + @default_value = options[:default] + @namespace = options[:namespace] + @in = options[:in] + end + + def default_value + if @default_value.respond_to?(:call) + @default_value.call + else + @default_value + end + end + + def type + if @default_value.is_a?(TrueClass) || @default_value.is_a?(FalseClass) + ActiveModel::Type::Boolean.new + else + ActiveModel::Type::String.new + end + end + + def type_cast(value) + if type.respond_to?(:cast) + type.cast(value) + else + value + end + end + + def to_a + [key, default_value] + end + + def key + if namespace + "#{namespace}.#{name}".to_sym + else + name + end + end +end diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index 4c7acbcac..994ca588a 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -3,6 +3,11 @@ class NotifyService < BaseService include Redisable + NON_EMAIL_TYPES = %i( + admin.report + admin.sign_up + ).freeze + def call(recipient, type, activity) @recipient = recipient @activity = activity @@ -36,11 +41,11 @@ class NotifyService < BaseService end def optional_non_follower? - @recipient.user.settings.interactions['must_be_follower'] && !@notification.from_account.following?(@recipient) + @recipient.user.settings['interactions.must_be_follower'] && !@notification.from_account.following?(@recipient) end def optional_non_following? - @recipient.user.settings.interactions['must_be_following'] && !following_sender? + @recipient.user.settings['interactions.must_be_following'] && !following_sender? end def message? @@ -82,7 +87,7 @@ class NotifyService < BaseService def optional_non_following_and_direct? direct_message? && - @recipient.user.settings.interactions['must_be_following_dm'] && + @recipient.user.settings['interactions.must_be_following_dm'] && !following_sender? && !response_to_recipient? end @@ -171,6 +176,6 @@ class NotifyService < BaseService end def send_email_for_notification_type? - @recipient.user.settings.notification_emails[@notification.type.to_s] + NON_EMAIL_TYPES.exclude?(@notification.type) && @recipient.user.settings["notification_emails.#{@notification.type}"] end end diff --git a/app/views/settings/preferences/appearance/show.html.haml b/app/views/settings/preferences/appearance/show.html.haml index bc23df647..5358310e5 100644 --- a/app/views/settings/preferences/appearance/show.html.haml +++ b/app/views/settings/preferences/appearance/show.html.haml @@ -9,57 +9,58 @@ .fields-group.fields-row__column.fields-row__column-6 = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| native_locale_name(locale) }, selected: I18n.locale, hint: false .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false, hint: false + = f.simple_fields_for :settings, current_user.settings do |ff| + = ff.input :theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false, hint: false - unless I18n.locale == :en .flash-message.translation-prompt #{t 'appearance.localization.body'} #{content_tag(:a, t('appearance.localization.guide_link_text'), href: t('appearance.localization.guide_link'), target: '_blank', rel: 'noopener')} - %h4= t 'appearance.advanced_web_interface' + = f.simple_fields_for :settings, current_user.settings do |ff| + %h4= t 'appearance.advanced_web_interface' - %p.hint= t 'appearance.advanced_web_interface_hint' + %p.hint= t 'appearance.advanced_web_interface_hint' - .fields-group - = f.input :setting_advanced_layout, as: :boolean, wrapper: :with_label, hint: false + .fields-group + = ff.input :'web.advanced_layout', wrapper: :with_label, hint: false, label: I18n.t('simple_form.labels.defaults.setting_advanced_layout') + %h4= t 'appearance.animations_and_accessibility' - %h4= t 'appearance.animations_and_accessibility' + .fields-group + = ff.input :'web.use_pending_items', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_use_pending_items'), hint: I18n.t('simple_form.hints.defaults.setting_use_pending_items') - .fields-group - = f.input :setting_use_pending_items, as: :boolean, wrapper: :with_label + .fields-group + = ff.input :'web.auto_play', wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_auto_play_gif') + = ff.input :'web.reduce_motion', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reduce_motion') + = ff.input :'web.disable_swiping', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_disable_swiping') + = ff.input :'web.use_system_font', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_system_font_ui') - .fields-group - = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label, recommended: true - = f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label - = f.input :setting_disable_swiping, as: :boolean, wrapper: :with_label - = f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label + %h4= t 'appearance.toot_layout' - %h4= t 'appearance.toot_layout' + .fields-group + = ff.input :'web.crop_images', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_crop_images') - .fields-group - = f.input :setting_crop_images, as: :boolean, wrapper: :with_label + %h4= t 'appearance.discovery' - %h4= t 'appearance.discovery' + .fields-group + = ff.input :'web.trends', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_trends') - .fields-group - = f.input :setting_trends, as: :boolean, wrapper: :with_label + %h4= t 'appearance.confirmation_dialogs' - %h4= t 'appearance.confirmation_dialogs' + .fields-group + = ff.input :'web.unfollow_modal', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_unfollow_modal') + = ff.input :'web.reblog_modal', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_boost_modal') + = ff.input :'web.delete_modal', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_delete_modal') - .fields-group - = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label - = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label - = f.input :setting_delete_modal, as: :boolean, wrapper: :with_label + %h4= t 'appearance.sensitive_content' - %h4= t 'appearance.sensitive_content' + .fields-group + = ff.input :'web.display_media', collection: ['default', 'show_all', 'hide_all'],label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label, label: I18n.t('simple_form.labels.defaults.setting_display_media') - .fields-group - = f.input :setting_display_media, collection: ['default', 'show_all', 'hide_all'], label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label + .fields-group + = ff.input :'web.use_blurhash', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_use_blurhash'), hint: I18n.t('simple_form.hints.defaults.setting_use_blurhash') - .fields-group - = f.input :setting_use_blurhash, as: :boolean, wrapper: :with_label - - .fields-group - = f.input :setting_expand_spoilers, as: :boolean, wrapper: :with_label + .fields-group + = ff.input :'web.expand_content_warnings', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_expand_spoilers') .actions = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/preferences/notifications/show.html.haml b/app/views/settings/preferences/notifications/show.html.haml index f00dbadd4..cb1ad0886 100644 --- a/app/views/settings/preferences/notifications/show.html.haml +++ b/app/views/settings/preferences/notifications/show.html.haml @@ -11,25 +11,25 @@ %p.hint= t 'notifications.email_events_hint' - .fields-group - = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff| - = ff.input :follow, as: :boolean, wrapper: :with_label - = ff.input :follow_request, as: :boolean, wrapper: :with_label - = ff.input :reblog, as: :boolean, wrapper: :with_label - = ff.input :favourite, as: :boolean, wrapper: :with_label - = ff.input :mention, as: :boolean, wrapper: :with_label - = ff.input :report, as: :boolean, wrapper: :with_label if current_user.can?(:manage_reports) - = ff.input :appeal, as: :boolean, wrapper: :with_label if current_user.can?(:manage_appeals) - = ff.input :pending_account, as: :boolean, wrapper: :with_label if current_user.can?(:manage_users) - = ff.input :trending_tag, as: :boolean, wrapper: :with_label if current_user.can?(:manage_taxonomies) - - .fields-group - = f.input :setting_always_send_emails, as: :boolean, wrapper: :with_label + = f.simple_fields_for :settings, current_user.settings do |ff| + .fields-group + = ff.input :'notification_emails.follow', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.follow') + = ff.input :'notification_emails.follow_request', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.follow_request') + = ff.input :'notification_emails.reblog', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.reblog') + = ff.input :'notification_emails.favourite', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.favourite') + = ff.input :'notification_emails.mention', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.mention') + = ff.input :'notification_emails.report', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.report') if current_user.can?(:manage_reports) + = ff.input :'notification_emails.appeal', as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.appeal') if current_user.can?(:manage_appeals) + = ff.input :'notification_emails.pending_account', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.pending_account') if current_user.can?(:manage_users) + = ff.input :'notification_emails.trends', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.trending_tag') if current_user.can?(:manage_taxonomies) + + .fields-group + = ff.input :always_send_emails, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_always_send_emails'), hint: I18n.t('simple_form.hints.defaults.setting_always_send_emails') %h4= t 'notifications.other_settings' .fields-group - = f.simple_fields_for :interactions, hash_to_object(current_user.settings.interactions) do |ff| - = ff.input :must_be_follower, as: :boolean, wrapper: :with_label - = ff.input :must_be_following, as: :boolean, wrapper: :with_label - = ff.input :must_be_following_dm, as: :boolean, wrapper: :with_label + = f.simple_fields_for :settings, current_user.settings do |ff| + = ff.input :'interactions.must_be_follower', wrapper: :with_label, label: I18n.t('simple_form.labels.interactions.must_be_follower') + = ff.input :'interactions.must_be_following', wrapper: :with_label, label: I18n.t('simple_form.labels.interactions.must_be_following') + = ff.input :'interactions.must_be_following_dm', wrapper: :with_label, label: I18n.t('simple_form.labels.interactions.must_be_following_dm') diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml index 44f4af2eb..6590ec7c2 100644 --- a/app/views/settings/preferences/other/show.html.haml +++ b/app/views/settings/preferences/other/show.html.haml @@ -7,26 +7,27 @@ = simple_form_for current_user, url: settings_preferences_other_path, html: { method: :put, id: 'edit_preferences' } do |f| = render 'shared/error_messages', object: current_user - .fields-group - = f.input :setting_noindex, as: :boolean, wrapper: :with_label + = f.simple_fields_for :settings, current_user.settings do |ff| + .fields-group + = ff.input :noindex, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_noindex'), hint: I18n.t('simple_form.hints.defaults.setting_noindex') - .fields-group - = f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label, recommended: true + .fields-group + = ff.input :aggregate_reblogs, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_aggregate_reblogs'), hint: I18n.t('simple_form.hints.defaults.setting_aggregate_reblogs') - %h4= t 'preferences.posting_defaults' + %h4= t 'preferences.posting_defaults' - .fields-row - .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_default_privacy, collection: Status.selectable_visibilities, wrapper: :with_label, include_blank: false, label_method: lambda { |visibility| safe_join([I18n.t("statuses.visibilities.#{visibility}"), I18n.t("statuses.visibilities.#{visibility}_long")], ' - ') }, required: false, hint: false + .fields-row + .fields-group.fields-row__column.fields-row__column-6 + = ff.input :default_privacy, collection: Status.selectable_visibilities, wrapper: :with_label, include_blank: false, label_method: lambda { |visibility| safe_join([I18n.t("statuses.visibilities.#{visibility}"), I18n.t("statuses.visibilities.#{visibility}_long")], ' - ') }, required: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_privacy') - .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_default_language, collection: [nil] + filterable_languages, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.default_language') : native_locale_name(locale) }, required: false, include_blank: false, hint: false + .fields-group.fields-row__column.fields-row__column-6 + = ff.input :default_language, collection: [nil] + filterable_languages, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.default_language') : native_locale_name(locale) }, required: false, include_blank: false, hint: false, label: I18n.t('simple_form.labels.defaults.setting_default_language') - .fields-group - = f.input :setting_default_sensitive, as: :boolean, wrapper: :with_label + .fields-group + = ff.input :default_sensitive, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_default_sensitive'), hint: I18n.t('simple_form.hints.defaults.setting_default_sensitive') - .fields-group - = f.input :setting_show_application, as: :boolean, wrapper: :with_label, recommended: true + .fields-group + = ff.input :show_application, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_show_application'), hint: I18n.t('simple_form.hints.defaults.setting_show_application') %h4= t 'preferences.public_timelines' diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index a361cb0ec..95f0b5788 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -26,6 +26,7 @@ ActiveSupport::Inflector.inflections(:en) do |inflect| inflect.acronym 'URL' inflect.acronym 'ASCII' inflect.acronym 'DeepL' + inflect.acronym 'DSL' inflect.singular 'data', 'data' end diff --git a/config/settings.yml b/config/settings.yml index f0b09dd5c..4ac521a4b 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -12,48 +12,14 @@ defaults: &defaults registrations_mode: 'open' profile_directory: true closed_registrations_message: '' - open_deletion: true - min_invite_role: 'admin' timeline_preview: true show_staff_badge: true - default_sensitive: false - unfollow_modal: false - boost_modal: false - delete_modal: true - auto_play_gif: false - display_media: 'default' - expand_spoilers: false preview_sensitive_media: false - reduce_motion: false - disable_swiping: false - show_application: true - system_font_ui: false noindex: false theme: 'default' - aggregate_reblogs: true - advanced_layout: false - use_blurhash: true - use_pending_items: false trends: true trends_as_landing_page: true trendable_by_default: false - crop_images: true - notification_emails: - follow: true - reblog: false - favourite: false - mention: true - follow_request: true - digest: true - report: true - pending_account: true - trending_tag: true - appeal: true - always_send_emails: false - interactions: - must_be_follower: false - must_be_following: false - must_be_following_dm: false reserved_usernames: - admin - support diff --git a/db/migrate/20230215074327_add_settings_to_users.rb b/db/migrate/20230215074327_add_settings_to_users.rb new file mode 100644 index 000000000..ff5308f42 --- /dev/null +++ b/db/migrate/20230215074327_add_settings_to_users.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSettingsToUsers < ActiveRecord::Migration[6.1] + def change + add_column :users, :settings, :text + end +end diff --git a/db/migrate/20230215074423_move_user_settings.rb b/db/migrate/20230215074423_move_user_settings.rb new file mode 100644 index 000000000..351a8b61d --- /dev/null +++ b/db/migrate/20230215074423_move_user_settings.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +class MoveUserSettings < ActiveRecord::Migration[6.1] + class User < ApplicationRecord; end + + MAPPING = { + default_privacy: 'default_privacy', + default_sensitive: 'web.default_sensitive', + default_language: 'default_language', + noindex: 'noindex', + theme: 'theme', + trends: 'web.trends', + unfollow_modal: 'web.unfollow_modal', + boost_modal: 'web.reblog_modal', + delete_modal: 'web.delete_modal', + auto_play_gif: 'web.auto_play', + display_media: 'web.display_media', + expand_spoilers: 'web.expand_content_warnings', + reduce_motion: 'web.reduce_motion', + disable_swiping: 'web.disable_swiping', + show_application: 'show_application', + system_font_ui: 'web.use_system_font', + aggregate_reblogs: 'aggregate_reblogs', + advanced_layout: 'web.advanced_layout', + use_blurhash: 'web.use_blurhash', + use_pending_items: 'web.use_pending_items', + crop_images: 'web.crop_images', + notification_emails: { + follow: 'notification_emails.follow', + reblog: 'notification_emails.reblog', + favourite: 'notification_emails.favourite', + mention: 'notification_emails.mention', + follow_request: 'notification_emails.follow_request', + report: 'notification_emails.report', + pending_account: 'notification_emails.pending_account', + trending_tag: 'notification_emails.trends', + appeal: 'notification_emails.appeal', + }.freeze, + always_send_emails: 'always_send_emails', + interactions: { + must_be_follower: 'interactions.must_be_follower', + must_be_following: 'interactions.must_be_following', + must_be_following_dm: 'interactions.must_be_following_dm', + }.freeze, + }.freeze + + class LegacySetting < ApplicationRecord + self.table_name = 'settings' + + def var + self[:var]&.to_sym + end + + def value + YAML.safe_load(self[:value], permitted_classes: [ActiveSupport::HashWithIndifferentAccess]) if self[:value].present? + end + end + + def up + User.find_each do |user| + previous_settings = LegacySetting.where(thing_type: 'User', thing_id: user.id).index_by(&:var) + + user_settings = {} + + MAPPING.each do |legacy_key, new_key| + value = previous_settings[legacy_key]&.value + + next if value.blank? + + if value.is_a?(Hash) + value.each do |nested_key, nested_value| + user_settings[MAPPING[legacy_key][nested_key.to_sym]] = nested_value + end + else + user_settings[new_key] = value + end + end + + user.update_column('settings', Oj.dump(user_settings)) # rubocop:disable Rails/SkipsModelValidations + end + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index 704cef122..620bed2bc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_12_06_114142) do +ActiveRecord::Schema.define(version: 2023_02_15_074423) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1060,6 +1060,7 @@ ActiveRecord::Schema.define(version: 2022_12_06_114142) do t.inet "sign_up_ip" t.boolean "skip_sign_in_token" t.bigint "role_id" + t.text "settings" t.index ["account_id"], name: "index_users_on_account_id" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id", where: "(created_by_application_id IS NOT NULL)" diff --git a/lib/tasks/tests.rake b/lib/tasks/tests.rake index 51a6ee0d7..35073b78b 100644 --- a/lib/tasks/tests.rake +++ b/lib/tasks/tests.rake @@ -54,7 +54,7 @@ namespace :tests do exit(1) end - unless User.find(1).settings.notification_emails['favourite'] == true && User.find(1).settings.notification_emails['mention'] == false + unless User.find(1).settings['notification_emails.favourite'] == true && User.find(1).settings['notification_emails.mention'] == false puts 'User settings not kept as expected' exit(1) end diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb index 57fe0aee6..b5d5c37a9 100644 --- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb @@ -46,6 +46,7 @@ describe Api::V1::Accounts::CredentialsController do end it 'updates account info' do + user.reload user.account.reload expect(user.account.display_name).to eq("Alice Isn't Dead") diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 35c7326cb..bc6c6c0c5 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -88,21 +88,19 @@ describe ApplicationController, type: :controller do it 'returns instances\'s default theme when user didn\'t set theme' do current_user = Fabricate(:user) + current_user.settings.update(theme: 'contrast', noindex: false) + current_user.save sign_in current_user - allow(Setting).to receive(:[]).with('theme').and_return 'contrast' - allow(Setting).to receive(:[]).with('noindex').and_return false - expect(controller.view_context.current_theme).to eq 'contrast' end it 'returns user\'s theme when it is set' do current_user = Fabricate(:user) - current_user.settings['theme'] = 'mastodon-light' + current_user.settings.update(theme: 'mastodon-light') + current_user.save sign_in current_user - allow(Setting).to receive(:[]).with('theme').and_return 'contrast' - expect(controller.view_context.current_theme).to eq 'mastodon-light' end end diff --git a/spec/controllers/settings/preferences/notifications_controller_spec.rb b/spec/controllers/settings/preferences/notifications_controller_spec.rb index 66fb8c5eb..29b7b6aec 100644 --- a/spec/controllers/settings/preferences/notifications_controller_spec.rb +++ b/spec/controllers/settings/preferences/notifications_controller_spec.rb @@ -20,20 +20,22 @@ describe Settings::Preferences::NotificationsController do describe 'PUT #update' do it 'updates notifications settings' do - user.settings['notification_emails'] = user.settings['notification_emails'].merge('follow' => false) - user.settings['interactions'] = user.settings['interactions'].merge('must_be_follower' => true) + user.settings.update('notification_emails.follow': false, 'interactions.must_be_follower': true) + user.save put :update, params: { user: { - notification_emails: { follow: '1' }, - interactions: { must_be_follower: '0' }, + settings_attributes: { + 'notification_emails.follow': '1', + 'interactions.must_be_follower': '0', + }, }, } expect(response).to redirect_to(settings_preferences_notifications_path) user.reload - expect(user.settings['notification_emails']['follow']).to be true - expect(user.settings['interactions']['must_be_follower']).to be false + expect(user.settings['notification_emails.follow']).to be true + expect(user.settings['interactions.must_be_follower']).to be false end end end diff --git a/spec/controllers/settings/preferences/other_controller_spec.rb b/spec/controllers/settings/preferences/other_controller_spec.rb index 63eeefaf0..249d1b5b5 100644 --- a/spec/controllers/settings/preferences/other_controller_spec.rb +++ b/spec/controllers/settings/preferences/other_controller_spec.rb @@ -29,20 +29,22 @@ describe Settings::Preferences::OtherController do end it 'updates user settings' do - user.settings['boost_modal'] = false - user.settings['delete_modal'] = true + user.settings.update('web.reblog_modal': false, 'web.delete_modal': true) + user.save put :update, params: { user: { - setting_boost_modal: '1', - setting_delete_modal: '0', + settings_attributes: { + 'web.reblog_modal': '1', + 'web.delete_modal': '0', + }, }, } expect(response).to redirect_to(settings_preferences_other_path) user.reload - expect(user.settings['boost_modal']).to be true - expect(user.settings['delete_modal']).to be false + expect(user.settings['web.reblog_modal']).to be true + expect(user.settings['web.delete_modal']).to be false end end end diff --git a/spec/lib/settings/extend_spec.rb b/spec/lib/settings/extend_spec.rb deleted file mode 100644 index ea623137b..000000000 --- a/spec/lib/settings/extend_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Settings::Extend do - class User - include Settings::Extend - end - - describe '#settings' do - it 'sets @settings as an instance of Settings::ScopedSettings' do - user = Fabricate(:user) - expect(user.settings).to be_a Settings::ScopedSettings - end - end -end diff --git a/spec/lib/settings/scoped_settings_spec.rb b/spec/lib/settings/scoped_settings_spec.rb deleted file mode 100644 index 7566685b4..000000000 --- a/spec/lib/settings/scoped_settings_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Settings::ScopedSettings do - let(:object) { Fabricate(:user) } - let(:scoped_setting) { described_class.new(object) } - let(:val) { 'whatever' } - let(:methods) { %i(auto_play_gif default_sensitive unfollow_modal boost_modal delete_modal reduce_motion system_font_ui noindex theme) } - - describe '.initialize' do - it 'sets @object' do - scoped_setting = described_class.new(object) - expect(scoped_setting.instance_variable_get(:@object)).to be object - end - end - - describe '#method_missing' do - it 'sets scoped_setting.method_name = val' do - methods.each do |key| - scoped_setting.send("#{key}=", val) - expect(scoped_setting.send(key)).to eq val - end - end - end - - describe '#[]= and #[]' do - it 'sets [key] = val' do - methods.each do |key| - scoped_setting[key] = val - expect(scoped_setting[key]).to eq val - end - end - end -end diff --git a/spec/lib/user_settings_decorator_spec.rb b/spec/lib/user_settings_decorator_spec.rb deleted file mode 100644 index 3b9b7ee2b..000000000 --- a/spec/lib/user_settings_decorator_spec.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe UserSettingsDecorator do - describe 'update' do - let(:user) { Fabricate(:user) } - let(:settings) { described_class.new(user) } - - it 'updates the user settings value for email notifications' do - values = { 'notification_emails' => { 'follow' => '1' } } - - settings.update(values) - expect(user.settings['notification_emails']['follow']).to be true - end - - it 'updates the user settings value for interactions' do - values = { 'interactions' => { 'must_be_follower' => '0' } } - - settings.update(values) - expect(user.settings['interactions']['must_be_follower']).to be false - end - - it 'updates the user settings value for privacy' do - values = { 'setting_default_privacy' => 'public' } - - settings.update(values) - expect(user.settings['default_privacy']).to eq 'public' - end - - it 'updates the user settings value for sensitive' do - values = { 'setting_default_sensitive' => '1' } - - settings.update(values) - expect(user.settings['default_sensitive']).to be true - end - - it 'updates the user settings value for unfollow modal' do - values = { 'setting_unfollow_modal' => '0' } - - settings.update(values) - expect(user.settings['unfollow_modal']).to be false - end - - it 'updates the user settings value for boost modal' do - values = { 'setting_boost_modal' => '1' } - - settings.update(values) - expect(user.settings['boost_modal']).to be true - end - - it 'updates the user settings value for delete toot modal' do - values = { 'setting_delete_modal' => '0' } - - settings.update(values) - expect(user.settings['delete_modal']).to be false - end - - it 'updates the user settings value for gif auto play' do - values = { 'setting_auto_play_gif' => '0' } - - settings.update(values) - expect(user.settings['auto_play_gif']).to be false - end - - it 'updates the user settings value for system font in UI' do - values = { 'setting_system_font_ui' => '0' } - - settings.update(values) - expect(user.settings['system_font_ui']).to be false - end - - it 'decoerces setting values before applying' do - values = { - 'setting_delete_modal' => 'false', - 'setting_boost_modal' => 'true', - } - - settings.update(values) - expect(user.settings['delete_modal']).to be false - expect(user.settings['boost_modal']).to be true - end - end -end diff --git a/spec/models/user_settings/namespace_spec.rb b/spec/models/user_settings/namespace_spec.rb new file mode 100644 index 000000000..ae2fa7b48 --- /dev/null +++ b/spec/models/user_settings/namespace_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe UserSettings::Namespace do + subject { described_class.new(name) } + + let(:name) { :foo } + + describe '#setting' do + before do + subject.setting :bar, default: 'baz' + end + + it 'adds setting to definitions' do + expect(subject.definitions[:'foo.bar']).to have_attributes(name: :bar, namespace: :foo, default_value: 'baz') + end + end + + describe '#definitions' do + it 'returns a hash' do + expect(subject.definitions).to be_a Hash + end + end +end diff --git a/spec/models/user_settings/setting_spec.rb b/spec/models/user_settings/setting_spec.rb new file mode 100644 index 000000000..6e4ec6789 --- /dev/null +++ b/spec/models/user_settings/setting_spec.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe UserSettings::Setting do + subject { described_class.new(name, options) } + + let(:name) { :foo } + let(:options) { { default: default, namespace: namespace } } + let(:default) { false } + let(:namespace) { nil } + + describe '#default_value' do + context 'when default value is a primitive value' do + it 'returns default value' do + expect(subject.default_value).to eq default + end + end + + context 'when default value is a proc' do + let(:default) { -> { 'bar' } } + + it 'returns value from proc' do + expect(subject.default_value).to eq 'bar' + end + end + end + + describe '#type' do + it 'returns a type' do + expect(subject.type).to be_a ActiveModel::Type::Value + end + end + + describe '#type_cast' do + context 'when default value is a boolean' do + let(:default) { false } + + it 'returns boolean' do + expect(subject.type_cast('1')).to be true + end + end + + context 'when default value is a string' do + let(:default) { '' } + + it 'returns string' do + expect(subject.type_cast(1)).to eq '1' + end + end + end + + describe '#to_a' do + it 'returns an array' do + expect(subject.to_a).to eq [name, default] + end + end + + describe '#key' do + context 'when there is no namespace' do + it 'returnsn a symbol' do + expect(subject.key).to eq :foo + end + end + + context 'when there is a namespace' do + let(:namespace) { :bar } + + it 'returns a symbol' do + expect(subject.key).to eq :'bar.foo' + end + end + end +end diff --git a/spec/models/user_settings_spec.rb b/spec/models/user_settings_spec.rb new file mode 100644 index 000000000..f0e4272fd --- /dev/null +++ b/spec/models/user_settings_spec.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe UserSettings do + subject { described_class.new(json) } + + let(:json) { {} } + + describe '#[]' do + context 'when setting is not set' do + it 'returns default value' do + expect(subject[:always_send_emails]).to be false + end + end + + context 'when setting is set' do + let(:json) { { default_language: 'fr' } } + + it 'returns value' do + expect(subject[:default_language]).to eq 'fr' + end + end + + context 'when setting was not defined' do + it 'raises error' do + expect { subject[:foo] }.to raise_error UserSettings::KeyError + end + end + end + + describe '#[]=' do + context 'when value matches type' do + before do + subject[:always_send_emails] = true + end + + it 'updates value' do + expect(subject[:always_send_emails]).to be true + end + end + + context 'when value needs to be type-cast' do + before do + subject[:always_send_emails] = '1' + end + + it 'updates value with a type-cast' do + expect(subject[:always_send_emails]).to be true + end + end + end + + describe '#update' do + before do + subject.update(always_send_emails: true, default_language: 'fr', default_privacy: nil) + end + + it 'updates values' do + expect(subject[:always_send_emails]).to be true + expect(subject[:default_language]).to eq 'fr' + end + + it 'does not set values that are nil' do + expect(subject.as_json).to_not include(default_privacy: nil) + end + end + + describe '#as_json' do + let(:json) { { default_language: 'fr' } } + + it 'returns hash' do + expect(subject.as_json).to eq json + end + end + + describe '.keys' do + it 'returns an array' do + expect(described_class.keys).to be_a Array + end + end + + describe '.definition_for' do + context 'when key is defined' do + it 'returns a setting' do + expect(described_class.definition_for(:always_send_emails)).to be_a UserSettings::Setting + end + end + + context 'when key is not defined' do + it 'returns nil' do + expect(described_class.definition_for(:foo)).to be_nil + end + end + end + + describe '.definition_for?' do + context 'when key is defined' do + it 'returns true' do + expect(described_class.definition_for?(:always_send_emails)).to be true + end + end + + context 'when key is not defined' do + it 'returns false' do + expect(described_class.definition_for?(:foo)).to be false + end + end + end +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 3e7b59f17..ab883927a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -313,9 +313,9 @@ RSpec.describe User, type: :model do end describe 'settings' do - it 'is instance of Settings::ScopedSettings' do + it 'is instance of UserSettings' do user = Fabricate(:user) - expect(user.settings).to be_a Settings::ScopedSettings + expect(user.settings).to be_a UserSettings end end @@ -379,16 +379,6 @@ RSpec.describe User, type: :model do end end - it_behaves_like 'Settings-extended' do - def create! - User.create!(account: Fabricate(:account, user: nil), email: 'foo@mastodon.space', password: 'abcd1234', agreement: true) - end - - def fabricate - Fabricate(:user) - end - end - describe 'token_for_app' do let(:user) { Fabricate(:user) } let(:app) { Fabricate(:application, owner: user) } diff --git a/spec/services/notify_service_spec.rb b/spec/services/notify_service_spec.rb index c58cebbfb..616a7aa20 100644 --- a/spec/services/notify_service_spec.rb +++ b/spec/services/notify_service_spec.rb @@ -54,7 +54,8 @@ RSpec.describe NotifyService, type: :service do let(:type) { :mention } before do - user.settings.interactions = user.settings.interactions.merge('must_be_following_dm' => enabled) + user.settings.update('interactions.must_be_following_dm': enabled) + user.save end context 'if recipient is supposed to be following sender' do @@ -155,8 +156,8 @@ RSpec.describe NotifyService, type: :service do before do ActionMailer::Base.deliveries.clear - notification_emails = user.settings.notification_emails - user.settings.notification_emails = notification_emails.merge('follow' => enabled) + user.settings.update('notification_emails.follow': enabled) + user.save end context 'when email notification is enabled' do diff --git a/spec/services/report_service_spec.rb b/spec/services/report_service_spec.rb index 9d81bd971..452400f72 100644 --- a/spec/services/report_service_spec.rb +++ b/spec/services/report_service_spec.rb @@ -96,7 +96,8 @@ RSpec.describe ReportService, type: :service do before do ActionMailer::Base.deliveries.clear - source_account.user.settings.notification_emails['report'] = true + source_account.user.settings['notification_emails.report'] = true + source_account.user.save end it 'does not send an e-mail' do -- cgit From 83fc97285b97ceaebb1dd878fd76883ad13dcfd0 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 31 Mar 2023 03:33:25 -0400 Subject: Enable Rubocop Metrics/BlockLength with Excludes (#24260) --- .rubocop.yml | 26 ++++++- .rubocop_todo.yml | 213 ------------------------------------------------------ 2 files changed, 25 insertions(+), 214 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index b5598b65a..dadb2075e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -50,10 +50,34 @@ Metrics/AbcSize: - 'lib/**/*cli*.rb' - db/*migrate/**/* +# Reason: Some functions cannot be broken up, but others may be refactor candidates +# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength Metrics/BlockLength: - CountAsOne: [array, heredoc] + CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] Exclude: - 'lib/mastodon/*_cli.rb' + - 'lib/tasks/*.rake' + - 'app/models/concerns/account_associations.rb' + - 'app/models/concerns/account_interactions.rb' + - 'app/models/concerns/ldap_authenticable.rb' + - 'app/models/concerns/omniauthable.rb' + - 'app/models/concerns/pam_authenticable.rb' + - 'app/models/concerns/remotable.rb' + - 'app/services/suspend_account_service.rb' + - 'app/services/unsuspend_account_service.rb' + - 'app/views/accounts/show.rss.ruby' + - 'app/views/tags/show.rss.ruby' + - 'config/environments/development.rb' + - 'config/environments/production.rb' + - 'config/initializers/devise.rb' + - 'config/initializers/doorkeeper.rb' + - 'config/initializers/omniauth.rb' + - 'config/initializers/simple_form.rb' + - 'config/navigation.rb' + - 'config/routes.rb' + - 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb' + - 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb' + - 'lib/paperclip/gif_transcoder.rb' Metrics/BlockNesting: Exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4ad266c8c..a3832ae70 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -117,7 +117,6 @@ Lint/ConstantDefinitionInBlock: - 'spec/lib/activitypub/adapter_spec.rb' - 'spec/lib/connection_pool/shared_connection_pool_spec.rb' - 'spec/lib/connection_pool/shared_timed_stack_spec.rb' - - 'spec/lib/settings/extend_spec.rb' - 'spec/models/concerns/remotable_spec.rb' # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. @@ -233,11 +232,6 @@ Lint/Void: Metrics/AbcSize: Max: 150 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. -# AllowedMethods: refine -Metrics/BlockLength: - Max: 544 - # Configuration parameters: CountBlocks, Max. Metrics/BlockNesting: Exclude: @@ -731,7 +725,6 @@ RSpec/LeakyConstantDeclaration: - 'spec/lib/activitypub/adapter_spec.rb' - 'spec/lib/connection_pool/shared_connection_pool_spec.rb' - 'spec/lib/connection_pool/shared_timed_stack_spec.rb' - - 'spec/lib/settings/extend_spec.rb' - 'spec/models/concerns/remotable_spec.rb' RSpec/LetSetup: @@ -881,204 +874,6 @@ RSpec/MultipleSubjects: - 'spec/controllers/follower_accounts_controller_spec.rb' - 'spec/controllers/following_accounts_controller_spec.rb' -# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. -# SupportedStyles: always, named_only -RSpec/NamedSubject: - Exclude: - - 'spec/controllers/admin/account_moderation_notes_controller_spec.rb' - - 'spec/controllers/admin/accounts_controller_spec.rb' - - 'spec/controllers/admin/confirmations_controller_spec.rb' - - 'spec/controllers/admin/custom_emojis_controller_spec.rb' - - 'spec/controllers/admin/domain_blocks_controller_spec.rb' - - 'spec/controllers/admin/instances_controller_spec.rb' - - 'spec/controllers/admin/invites_controller_spec.rb' - - 'spec/controllers/admin/report_notes_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/notes_controller_spec.rb' - - 'spec/controllers/api/v1/accounts/pins_controller_spec.rb' - - 'spec/controllers/api/v1/admin/domain_blocks_controller_spec.rb' - - 'spec/controllers/auth/passwords_controller_spec.rb' - - 'spec/controllers/auth/registrations_controller_spec.rb' - - 'spec/controllers/home_controller_spec.rb' - - 'spec/controllers/invites_controller_spec.rb' - - 'spec/controllers/oauth/authorizations_controller_spec.rb' - - 'spec/controllers/oauth/authorized_applications_controller_spec.rb' - - 'spec/controllers/relationships_controller_spec.rb' - - 'spec/controllers/settings/featured_tags_controller_spec.rb' - - 'spec/controllers/settings/migrations_controller_spec.rb' - - 'spec/controllers/settings/sessions_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb' - - 'spec/controllers/well_known/webfinger_controller_spec.rb' - - 'spec/features/log_in_spec.rb' - - 'spec/features/profile_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/connection_pool/shared_connection_pool_spec.rb' - - 'spec/lib/connection_pool/shared_timed_stack_spec.rb' - - 'spec/lib/delivery_failure_tracker_spec.rb' - - 'spec/lib/emoji_formatter_spec.rb' - - 'spec/lib/entity_cache_spec.rb' - - 'spec/lib/fast_ip_map_spec.rb' - - 'spec/lib/feed_manager_spec.rb' - - 'spec/lib/hashtag_normalizer_spec.rb' - - 'spec/lib/html_aware_formatter_spec.rb' - - 'spec/lib/link_details_extractor_spec.rb' - - 'spec/lib/ostatus/tag_manager_spec.rb' - - 'spec/lib/plain_text_formatter_spec.rb' - - 'spec/lib/request_pool_spec.rb' - - 'spec/lib/request_spec.rb' - - 'spec/lib/sanitize_config_spec.rb' - - 'spec/lib/status_finder_spec.rb' - - 'spec/lib/status_reach_finder_spec.rb' - - 'spec/lib/suspicious_sign_in_detector_spec.rb' - - 'spec/lib/text_formatter_spec.rb' - - 'spec/lib/vacuum/access_tokens_vacuum_spec.rb' - - 'spec/lib/vacuum/backups_vacuum_spec.rb' - - 'spec/lib/vacuum/feeds_vacuum_spec.rb' - - 'spec/lib/vacuum/media_attachments_vacuum_spec.rb' - - 'spec/lib/vacuum/preview_cards_vacuum_spec.rb' - - 'spec/lib/vacuum/statuses_vacuum_spec.rb' - - 'spec/lib/vacuum/system_keys_vacuum_spec.rb' - - 'spec/models/account/field_spec.rb' - - 'spec/models/account_migration_spec.rb' - - 'spec/models/account_spec.rb' - - 'spec/models/account_statuses_cleanup_policy_spec.rb' - - 'spec/models/account_statuses_filter_spec.rb' - - 'spec/models/admin/account_action_spec.rb' - - 'spec/models/canonical_email_block_spec.rb' - - 'spec/models/concerns/account_interactions_spec.rb' - - 'spec/models/custom_emoji_filter_spec.rb' - - 'spec/models/custom_emoji_spec.rb' - - 'spec/models/follow_spec.rb' - - 'spec/models/home_feed_spec.rb' - - 'spec/models/media_attachment_spec.rb' - - 'spec/models/notification_spec.rb' - - 'spec/models/public_feed_spec.rb' - - 'spec/models/relationship_filter_spec.rb' - - 'spec/models/remote_follow_spec.rb' - - 'spec/models/report_spec.rb' - - 'spec/models/session_activation_spec.rb' - - 'spec/models/setting_spec.rb' - - 'spec/models/status_spec.rb' - - 'spec/models/tag_spec.rb' - - 'spec/models/trends/statuses_spec.rb' - - 'spec/models/trends/tags_spec.rb' - - 'spec/models/user_role_spec.rb' - - 'spec/models/user_spec.rb' - - 'spec/models/web/push_subscription_spec.rb' - - 'spec/policies/account_moderation_note_policy_spec.rb' - - 'spec/policies/account_policy_spec.rb' - - 'spec/policies/backup_policy_spec.rb' - - 'spec/policies/custom_emoji_policy_spec.rb' - - 'spec/policies/domain_block_policy_spec.rb' - - 'spec/policies/email_domain_block_policy_spec.rb' - - 'spec/policies/instance_policy_spec.rb' - - 'spec/policies/invite_policy_spec.rb' - - 'spec/policies/relay_policy_spec.rb' - - 'spec/policies/report_note_policy_spec.rb' - - 'spec/policies/report_policy_spec.rb' - - 'spec/policies/settings_policy_spec.rb' - - 'spec/policies/status_policy_spec.rb' - - 'spec/policies/tag_policy_spec.rb' - - 'spec/policies/user_policy_spec.rb' - - 'spec/presenters/familiar_followers_presenter_spec.rb' - - 'spec/serializers/activitypub/note_serializer_spec.rb' - - 'spec/serializers/activitypub/update_poll_serializer_spec.rb' - - 'spec/serializers/rest/account_serializer_spec.rb' - - 'spec/services/account_search_service_spec.rb' - - 'spec/services/account_statuses_cleanup_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_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/after_block_domain_from_account_service_spec.rb' - - 'spec/services/after_block_service_spec.rb' - - 'spec/services/app_sign_up_service_spec.rb' - - 'spec/services/authorize_follow_service_spec.rb' - - 'spec/services/batched_remove_status_service_spec.rb' - - 'spec/services/block_domain_service_spec.rb' - - 'spec/services/block_service_spec.rb' - - 'spec/services/bootstrap_timeline_service_spec.rb' - - 'spec/services/clear_domain_media_service_spec.rb' - - 'spec/services/delete_account_service_spec.rb' - - 'spec/services/fan_out_on_write_service_spec.rb' - - 'spec/services/favourite_service_spec.rb' - - 'spec/services/fetch_link_card_service_spec.rb' - - 'spec/services/fetch_oembed_service_spec.rb' - - 'spec/services/fetch_remote_status_service_spec.rb' - - 'spec/services/fetch_resource_service_spec.rb' - - 'spec/services/follow_service_spec.rb' - - 'spec/services/import_service_spec.rb' - - 'spec/services/mute_service_spec.rb' - - 'spec/services/notify_service_spec.rb' - - 'spec/services/post_status_service_spec.rb' - - 'spec/services/precompute_feed_service_spec.rb' - - 'spec/services/process_mentions_service_spec.rb' - - 'spec/services/purge_domain_service_spec.rb' - - 'spec/services/reblog_service_spec.rb' - - 'spec/services/reject_follow_service_spec.rb' - - 'spec/services/remove_from_followers_service_spec.rb' - - 'spec/services/remove_status_service_spec.rb' - - 'spec/services/report_service_spec.rb' - - 'spec/services/resolve_account_service_spec.rb' - - 'spec/services/resolve_url_service_spec.rb' - - 'spec/services/search_service_spec.rb' - - 'spec/services/suspend_account_service_spec.rb' - - 'spec/services/unallow_domain_service_spec.rb' - - 'spec/services/unblock_domain_service_spec.rb' - - 'spec/services/unblock_service_spec.rb' - - 'spec/services/unfollow_service_spec.rb' - - 'spec/services/unsuspend_account_service_spec.rb' - - 'spec/services/update_account_service_spec.rb' - - 'spec/services/update_status_service_spec.rb' - - 'spec/services/verify_link_service_spec.rb' - - 'spec/validators/blacklisted_email_validator_spec.rb' - - 'spec/validators/email_mx_validator_spec.rb' - - 'spec/validators/note_length_validator_spec.rb' - - 'spec/validators/reaction_validator_spec.rb' - - 'spec/validators/status_length_validator_spec.rb' - - 'spec/validators/status_pin_validator_spec.rb' - - 'spec/validators/unique_username_validator_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' - - 'spec/workers/admin/domain_purge_worker_spec.rb' - - 'spec/workers/domain_block_worker_spec.rb' - - 'spec/workers/domain_clear_media_worker_spec.rb' - - 'spec/workers/feed_insert_worker_spec.rb' - - 'spec/workers/move_worker_spec.rb' - - 'spec/workers/publish_scheduled_announcement_worker_spec.rb' - - 'spec/workers/publish_scheduled_status_worker_spec.rb' - - 'spec/workers/refollow_worker_spec.rb' - - 'spec/workers/regeneration_worker_spec.rb' - - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb' - - 'spec/workers/scheduler/user_cleanup_scheduler_spec.rb' - - 'spec/workers/unfollow_follow_worker_spec.rb' - - 'spec/workers/web/push_notification_worker_spec.rb' - # Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 6 @@ -1477,7 +1272,6 @@ Rails/CompactBlank: - 'app/helpers/statuses_helper.rb' - 'app/models/concerns/attachmentable.rb' - 'app/models/poll.rb' - - 'app/models/user.rb' - 'app/services/import_service.rb' - 'config/initializers/paperclip.rb' @@ -1528,7 +1322,6 @@ Rails/FilePath: - 'app/validators/reaction_validator.rb' - 'config/environments/test.rb' - 'db/migrate/20170716191202_add_hide_notifications_to_mute.rb' - - 'db/migrate/20170918125918_ids_to_bigints.rb' - 'db/migrate/20171005171936_add_disabled_to_custom_emojis.rb' - 'db/migrate/20171028221157_add_reblogs_to_follows.rb' - 'db/migrate/20171107143332_add_memorial_to_accounts.rb' @@ -1648,7 +1441,6 @@ Rails/IgnoredColumnsAssignment: - 'app/models/email_domain_block.rb' - 'app/models/report.rb' - 'app/models/status_edit.rb' - - 'app/models/user.rb' # Configuration parameters: IgnoreScopes, Include. # Include: app/models/**/*.rb @@ -2530,11 +2322,6 @@ Style/PreferredHashMethods: Exclude: - 'config/initializers/paperclip.rb' -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantBegin: - Exclude: - - 'config/initializers/simple_form.rb' - # This cop supports safe autocorrection (--autocorrect). Style/RedundantConstantBase: Exclude: -- cgit From 1f19d5e5e84731f781e13e4cedab386c294bee2f Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 31 Mar 2023 10:08:53 -0400 Subject: Add documentation for Rubocop overrides (#23811) --- .rubocop.yml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 14 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index dadb2075e..e6a0c2d14 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,7 @@ +# Can be removed once all rules are addressed or moved to this file as documented overrides inherit_from: .rubocop_todo.yml +# Used for merging with exclude lists with .rubocop_todo.yml inherit_mode: merge: - Exclude @@ -11,13 +13,13 @@ require: - rubocop-capybara AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 2.7 # Set to minimum supported version of CI DisplayCopNames: true DisplayStyleGuide: true ExtraDetails: true UseCache: true CacheRootDirectory: tmp - NewCops: enable + NewCops: enable # Opt-in to newly added rules Exclude: - db/schema.rb - 'bin/*' @@ -25,12 +27,16 @@ AllCops: - 'node_modules/**/*' - 'Vagrantfile' - 'vendor/**/*' - - 'lib/json_ld/*' + - 'lib/json_ld/*' # Generated files - 'lib/templates/**/*' +# Reason: Prefer Hashes without extreme indentation +# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirsthashelementindentation Layout/FirstHashElementIndentation: EnforcedStyle: consistent +# Reason: Currently disabled in .rubocop_todo.yml +# https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinelength Layout/LineLength: AllowedPatterns: # Allow comments to be long lines @@ -41,10 +47,14 @@ Layout/LineLength: - db/*migrate/**/* - db/seeds/**/* +# Reason: +# https://docs.rubocop.org/rubocop/cops_lint.html#lintuselessaccessmodifier Lint/UselessAccessModifier: ContextCreatingMethods: - class_methods +# Reason: Currently disabled in .rubocop_todo.yml +# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize Metrics/AbcSize: Exclude: - 'lib/**/*cli*.rb' @@ -79,6 +89,8 @@ Metrics/BlockLength: - 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb' - 'lib/paperclip/gif_transcoder.rb' +# Reason: +# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting Metrics/BlockNesting: Exclude: - 'lib/mastodon/*_cli.rb' @@ -127,22 +139,32 @@ Metrics/ClassLength: - 'app/services/update_status_service.rb' - 'lib/paperclip/color_extractor.rb' +# Reason: Currently disabled in .rubocop_todo.yml +# https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity Metrics/CyclomaticComplexity: Exclude: - lib/mastodon/*cli*.rb - db/*migrate/**/* +# Reason: Currently disabled in .rubocop_todo.yml +# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength Metrics/MethodLength: CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' +# Reason: +# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuestandarderror Metrics/ModuleLength: CountAsOne: [array, heredoc] +# Reason: Prevailing style uses numeric status codes, matches RSpec/Rails/HttpStatus +# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railshttpstatus Rails/HttpStatus: EnforcedStyle: numeric +# Reason: Allowed only in the `tootctl` CLI application code +# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsexit Rails/Exit: Exclude: - 'lib/mastodon/*_cli.rb' @@ -170,9 +192,18 @@ RSpec/FilePath: - 'spec/controllers/concerns/signature_verification_spec.rb' - 'spec/controllers/concerns/user_tracking_concern_spec.rb' +# Reason: +# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnamedsubject +RSpec/NamedSubject: + EnforcedStyle: named_only + +# Reason: Prevailing style choice +# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnottonot RSpec/NotToNot: EnforcedStyle: to_not +# Reason: Prevailing style uses numeric status codes, matches Rails/HttpStatus +# https://docs.rubocop.org/rubocop-rspec/cops_rspec_rails.html#rspecrailshttpstatus RSpec/Rails/HttpStatus: EnforcedStyle: numeric @@ -186,34 +217,45 @@ Style/ClassAndModuleChildren: Style/Documentation: Enabled: false +# Reason: Enforce modern Ruby style +# https://docs.rubocop.org/rubocop/cops_style.html#stylehashsyntax Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys +# Reason: +# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericliterals Style/NumericLiterals: AllowedPatterns: - \d{4}_\d{2}_\d{2}_\d{6} # For DB migration date version number readability +# Reason: +# https://docs.rubocop.org/rubocop/cops_style.html#stylepercentliteraldelimiters Style/PercentLiteralDelimiters: PreferredDelimiters: '%i': '()' '%w': '()' +# Reason: Prefer less indentation in conditional assignments +# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantbegin +Style/RedundantBegin: + Enabled: false + +# Reason: Overridden to reduce implicit StandardError rescues +# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuestandarderror Style/RescueStandardError: EnforcedStyle: implicit +# Reason: Originally disabled for CodeClimate, and no config consensus has been found +# https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolarray +Style/SymbolArray: + Enabled: false + +# Reason: +# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainarrayliteral Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: 'comma' +# Reason: +# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: 'comma' - -Style/SymbolArray: - Enabled: false - -# Reason: Prefer less intendation in conditional assignments -# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantbegin -Style/RedundantBegin: - Enabled: false - -RSpec/NamedSubject: - EnforcedStyle: named_only -- cgit