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

Add if to allowed names list for MethodParameterName #11158

Merged

Conversation

okuramasafumi
Copy link
Contributor

In library development, we sometimes use if as a keyword argument.
The meaning of if is clear enough so we can accept it as an allowed name.

I'm not sure if it deserves its own CHANGELOG entry, but please let me know if I should add it.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@koic
Copy link
Member

koic commented Nov 6, 2022

It makes sense to me.

I'm not sure if it deserves its own CHANGELOG entry, but please let me know if I should add it.

Yeah, can you add a changelog entry? Because this change impacts users.

@okuramasafumi okuramasafumi force-pushed the add-if-to-allowed-parameter-name branch from 6813945 to 8f1aff5 Compare November 6, 2022 14:08
CHANGELOG.md Outdated
@@ -11,6 +11,7 @@
* [#11126](https://github.com/rubocop/rubocop/pull/11126): Have `Lint/RedundantRequireStatement` mark `set` as a redundant require in Ruby 3.2+. ([@drenmi][])
* [#11001](https://github.com/rubocop/rubocop/pull/11001): Add option to raise cop errors `--raise-cop-error`. ([@wildmaples][])
* [#10987](https://github.com/rubocop/rubocop/pull/10987): Opt-in cop compatibility in redundant directives. ([@tdeo][])
* [#11158](https://github.com/rubocop/rubocop/pull/11158): Add `if` to allowed names list for MethodParameterName. ([@okuramasafumi][])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog entry file instead of editing CHANGELOG.md directly:

e.g. e2c1298

In library development, we sometimes use `if` as a keyword argument.
The meaning of `if` is clear enough so we can accept it as an
allowed name.
@okuramasafumi okuramasafumi force-pushed the add-if-to-allowed-parameter-name branch from 8f1aff5 to 9cc6719 Compare November 6, 2022 15:04
@koic koic merged commit c94f499 into rubocop:master Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants