From 8365ad83191ccc029c890b866bd55230310f66b4 Mon Sep 17 00:00:00 2001 From: GitLab Housekeeping Bot Date: Mon, 28 Jul 2025 04:18:59 +0000 Subject: [PATCH] Fix 13 rubocop violations for InternalAffairs/RedundantMessageArgument Fixes the 13 violations for the rubocop rule `InternalAffairs/RedundantMessageArgument` that were previously excluded in `.rubocop_todo/internal_affairs/redundant_message_argument.yml`. The exclusions have now been removed. This change was generated by [gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper) in [CI](https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/jobs/10826130671) using the `Gitlab::Housekeeper::Keeps::RubocopFixer` keep. To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the label ~"GitLab Housekeeper" and consider pinging the author of this keep. Changelog: other --- .../redundant_message_argument.yml | 18 ------------------ rubocop/cop/feature_flag_usage.rb | 2 +- rubocop/cop/file_decompression.rb | 4 ++-- .../cop/gitlab/feature_flag_without_actor.rb | 2 +- rubocop/cop/gitlab/license_available_usage.rb | 2 +- rubocop/cop/gitlab/no_find_in_workers.rb | 2 +- .../cop/migration/async_post_migrate_only.rb | 2 +- .../migration/batch_migrations_post_only.rb | 2 +- .../cop/migration/migration_with_milestone.rb | 2 +- ...e_statement_with_disable_ddl_transaction.rb | 2 +- .../schema_addition_methods_no_post.rb | 2 +- rubocop/cop/redis_queue_usage.rb | 4 ++-- rubocop/cop/sidekiq_api_usage.rb | 2 +- rubocop/cop/sidekiq_redis_call.rb | 2 +- 14 files changed, 15 insertions(+), 33 deletions(-) delete mode 100644 .rubocop_todo/internal_affairs/redundant_message_argument.yml diff --git a/.rubocop_todo/internal_affairs/redundant_message_argument.yml b/.rubocop_todo/internal_affairs/redundant_message_argument.yml deleted file mode 100644 index 4f69368ced6c32..00000000000000 --- a/.rubocop_todo/internal_affairs/redundant_message_argument.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Cop supports --autocorrect. -InternalAffairs/RedundantMessageArgument: - Details: grace period - Exclude: - - 'rubocop/cop/feature_flag_usage.rb' - - 'rubocop/cop/file_decompression.rb' - - 'rubocop/cop/gitlab/feature_flag_without_actor.rb' - - 'rubocop/cop/gitlab/license_available_usage.rb' - - 'rubocop/cop/gitlab/no_find_in_workers.rb' - - 'rubocop/cop/migration/async_post_migrate_only.rb' - - 'rubocop/cop/migration/batch_migrations_post_only.rb' - - 'rubocop/cop/migration/migration_with_milestone.rb' - - 'rubocop/cop/migration/prevent_single_statement_with_disable_ddl_transaction.rb' - - 'rubocop/cop/migration/schema_addition_methods_no_post.rb' - - 'rubocop/cop/redis_queue_usage.rb' - - 'rubocop/cop/sidekiq_api_usage.rb' - - 'rubocop/cop/sidekiq_redis_call.rb' diff --git a/rubocop/cop/feature_flag_usage.rb b/rubocop/cop/feature_flag_usage.rb index 2220238454b54f..457f939ad1bdb0 100644 --- a/rubocop/cop/feature_flag_usage.rb +++ b/rubocop/cop/feature_flag_usage.rb @@ -13,7 +13,7 @@ class FeatureFlagUsage < RuboCop::Cop::Base def on_send(node) return unless using_feature_flag?(node) - add_offense(node, message: MSG) + add_offense(node) end end end diff --git a/rubocop/cop/file_decompression.rb b/rubocop/cop/file_decompression.rb index ef53e352ff7c78..1a75b55b0bed98 100644 --- a/rubocop/cop/file_decompression.rb +++ b/rubocop/cop/file_decompression.rb @@ -25,13 +25,13 @@ class FileDecompression < RuboCop::Cop::Base def on_xstr(node) subshell?(node) do |match| - add_offense(node, message: MSG) if forbidden_command?(match) + add_offense(node) if forbidden_command?(match) end end def on_send(node) system?(node) do |match| - add_offense(node, message: MSG) if forbidden_command?(match) + add_offense(node) if forbidden_command?(match) end end diff --git a/rubocop/cop/gitlab/feature_flag_without_actor.rb b/rubocop/cop/gitlab/feature_flag_without_actor.rb index 337cf62c92a050..5808d372a0bafa 100644 --- a/rubocop/cop/gitlab/feature_flag_without_actor.rb +++ b/rubocop/cop/gitlab/feature_flag_without_actor.rb @@ -19,7 +19,7 @@ class FeatureFlagWithoutActor < RuboCop::Cop::Base def on_send(node) return unless using_feature_flag_without_actor?(node) - add_offense(node, message: MSG) + add_offense(node) end end end diff --git a/rubocop/cop/gitlab/license_available_usage.rb b/rubocop/cop/gitlab/license_available_usage.rb index 8a3b5f49a33a19..6eaddf41de3d28 100644 --- a/rubocop/cop/gitlab/license_available_usage.rb +++ b/rubocop/cop/gitlab/license_available_usage.rb @@ -19,7 +19,7 @@ class LicenseAvailableUsage < RuboCop::Cop::Base PATTERN def on_send(node) - add_offense(node, message: MSG) if license_feature_available?(node) + add_offense(node) if license_feature_available?(node) end end end diff --git a/rubocop/cop/gitlab/no_find_in_workers.rb b/rubocop/cop/gitlab/no_find_in_workers.rb index f8d418bd55d006..8e8f7f674e70bb 100644 --- a/rubocop/cop/gitlab/no_find_in_workers.rb +++ b/rubocop/cop/gitlab/no_find_in_workers.rb @@ -36,7 +36,7 @@ class NoFindInWorkers < RuboCop::Cop::Base PATTERN def on_send(node) - add_offense(node, message: MSG) + add_offense(node) end end end diff --git a/rubocop/cop/migration/async_post_migrate_only.rb b/rubocop/cop/migration/async_post_migrate_only.rb index e5b78617691b3a..5a394d54d14aac 100644 --- a/rubocop/cop/migration/async_post_migrate_only.rb +++ b/rubocop/cop/migration/async_post_migrate_only.rb @@ -24,7 +24,7 @@ def on_send(node) return unless FORBIDDEN_METHODS.include?(node.method_name) return if in_post_deployment_migration?(node) - add_offense(node, message: MSG) + add_offense(node) end end end diff --git a/rubocop/cop/migration/batch_migrations_post_only.rb b/rubocop/cop/migration/batch_migrations_post_only.rb index 28dfb1228da4ce..4ad785a512882e 100644 --- a/rubocop/cop/migration/batch_migrations_post_only.rb +++ b/rubocop/cop/migration/batch_migrations_post_only.rb @@ -29,7 +29,7 @@ def on_send(node) on_forbidden_method(node) do break if in_post_deployment_migration?(node) - add_offense(node, message: MSG) + add_offense(node) end end end diff --git a/rubocop/cop/migration/migration_with_milestone.rb b/rubocop/cop/migration/migration_with_milestone.rb index d217527b4c76ed..38a93323bf80ad 100644 --- a/rubocop/cop/migration/migration_with_milestone.rb +++ b/rubocop/cop/migration/migration_with_milestone.rb @@ -22,7 +22,7 @@ def on_class(node) body_node = node.body return unless body_node - add_offense(node, message: MSG) unless milestone_call?(body_node) + add_offense(node) unless milestone_call?(body_node) end end end diff --git a/rubocop/cop/migration/prevent_single_statement_with_disable_ddl_transaction.rb b/rubocop/cop/migration/prevent_single_statement_with_disable_ddl_transaction.rb index 88e1befe5020df..c9dcd7aa12ab0e 100644 --- a/rubocop/cop/migration/prevent_single_statement_with_disable_ddl_transaction.rb +++ b/rubocop/cop/migration/prevent_single_statement_with_disable_ddl_transaction.rb @@ -78,7 +78,7 @@ def on_begin(node) end if disable_ddl_transaction_node && has_validate_foreign_key && statement_count == 1 - add_offense(disable_ddl_transaction_node, message: MSG) + add_offense(disable_ddl_transaction_node) end end end diff --git a/rubocop/cop/migration/schema_addition_methods_no_post.rb b/rubocop/cop/migration/schema_addition_methods_no_post.rb index 874ba222d93f08..1170c091a4864e 100644 --- a/rubocop/cop/migration/schema_addition_methods_no_post.rb +++ b/rubocop/cop/migration/schema_addition_methods_no_post.rb @@ -34,7 +34,7 @@ def on_send(node) return if rolling_back_migration?(node) on_forbidden_method(node) do - add_offense(node, message: MSG) + add_offense(node) end end diff --git a/rubocop/cop/redis_queue_usage.rb b/rubocop/cop/redis_queue_usage.rb index 66202f4666a1d7..c16d03d61beb45 100644 --- a/rubocop/cop/redis_queue_usage.rb +++ b/rubocop/cop/redis_queue_usage.rb @@ -27,13 +27,13 @@ class RedisQueueUsage < RuboCop::Cop::Base def on_send(node) return unless using_redis_queue_module_as_parameter?(node) || calling_redis_queue_module_methods?(node) - add_offense(node, message: MSG) + add_offense(node) end # offenses caught in assignment may overlap with on_send %i[on_lvasgn on_ivasgn on_cvasgn on_gvasgn on_casgn on_masgn on_op_asgn on_or_asgn on_and_asgn].each do |name| define_method(name) do |node| - add_offense(node, message: MSG) if redis_queue_assignment?(node) + add_offense(node) if redis_queue_assignment?(node) end end end diff --git a/rubocop/cop/sidekiq_api_usage.rb b/rubocop/cop/sidekiq_api_usage.rb index 62816a781fd766..022755bb0c4a84 100644 --- a/rubocop/cop/sidekiq_api_usage.rb +++ b/rubocop/cop/sidekiq_api_usage.rb @@ -31,7 +31,7 @@ def on_send(node) # allow Sidekiq::Client.via calls next if klass == :Client && ALLOWED_CLIENT_METHODS.include?(methods_called[0]) - add_offense(node, message: MSG) + add_offense(node) end end end diff --git a/rubocop/cop/sidekiq_redis_call.rb b/rubocop/cop/sidekiq_redis_call.rb index e4ae430f7c7302..1f1ad952a2feb9 100644 --- a/rubocop/cop/sidekiq_redis_call.rb +++ b/rubocop/cop/sidekiq_redis_call.rb @@ -11,7 +11,7 @@ class SidekiqRedisCall < RuboCop::Cop::Base PATTERN def on_send(node) - add_offense(node, message: MSG) if using_sidekiq_redis?(node) + add_offense(node) if using_sidekiq_redis?(node) end end end -- GitLab