Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark autocorrection for Lint/UnusedMethodArgument as unsafe #11020

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/fix_mark_autocorrection_for.md
@@ -0,0 +1 @@
* [#11020](https://github.com/rubocop/rubocop/pull/11020): Mark autocorrection for Lint/UnusedMethodArgument as unsafe. ([@dduugg][])
3 changes: 2 additions & 1 deletion config/default.yml
Expand Up @@ -2366,8 +2366,9 @@ Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.21'
VersionChanged: '0.81'
VersionChanged: '<<next>>'
AllowUnusedKeywordArguments: false
IgnoreEmptyMethods: true
IgnoreNotImplementedMethods: true
Expand Down
5 changes: 5 additions & 0 deletions lib/rubocop/cop/lint/unused_method_argument.rb
Expand Up @@ -5,6 +5,11 @@ module Cop
module Lint
# Checks for unused method arguments.
#
# @safety
# Autocorrection for this cop is not safe. There may be metaprogramming attached to the
# method (such as a Sorbet `sig`), YARD annoations, and type signtures in RBI or RBS files,
# which will retain the previous argument names under autocorrection.
#
# @example
# # bad
# def some_method(used, unused, _unused_but_allowed)
Expand Down