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

AllowedIdentifiers should also check variable assignments. #9136

Merged

Conversation

PhilCoggins
Copy link
Contributor

@PhilCoggins PhilCoggins commented Dec 1, 2020

#9017 Adds AllowedIdentifiers option to allow a preconfigured list of names for symbols and method definitions to ignore for the Naming/VariableNumber cop. The cop also checks for variable names, but for whatever reason, does not utilize AllowedIdentifiers. It is not intuitive that AllowedIdentifiers only checks method names and symbols but ignores variable assignment, so therefore it should be included. Further fixes #9012.


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.

@PhilCoggins PhilCoggins force-pushed the allowed_identifiers_includes_assignments branch from fdcf38c to a053fc2 Compare December 1, 2020 17:57
@dvandersluis
Copy link
Member

Thanks, this was an oversight in #9017.

@@ -0,0 +1 @@
* [#9136](https://github.com/rubocop-hq/rubocop/pull/9136): Fix `AllowedIdentifiers` in `Naming/VariableNumber` to include variable assignments. ([@PhilCoggins][])
Copy link
Member

Choose a reason for hiding this comment

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

You need to add your link at the bottom of CHANGELOG.md too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you talking about link to my GH profile? I followed the formatting in https://github.com/rubocop-hq/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format which says to use an implicit link?

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, it's taken care of automatically now. Sorry about that.

@bbatsov bbatsov merged commit 9a8777f into rubocop:master Dec 1, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Dec 1, 2020

Thanks!

PhilCoggins added a commit to PhilCoggins/rubocop that referenced this pull request Dec 1, 2020
@dvandersluis dvandersluis mentioned this pull request Dec 1, 2020
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.

Allow List for "Naming/VariableNumber"
3 participants