KEMBAR78
Enhance `Naming/MethodName` cop to detect offenses within `Data` members by viralpraxis · Pull Request #14374 · rubocop/rubocop · GitHub
Skip to content

Conversation

@viralpraxis
Copy link
Contributor

This is a follow-up to #14325.


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.
  • 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.

Comment on lines 109 to 110
# @!method new_data?(node)
def_node_matcher :new_data?, '(send (const {nil? cbase} :Data) :define ...)'
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps define_data is more appropriate than new_data?

Suggested change
# @!method new_data?(node)
def_node_matcher :new_data?, '(send (const {nil? cbase} :Data) :define ...)'
# @!method define_data?(node)
def_node_matcher :define_data?, '(send (const {nil? cbase} :Data) :define ...)'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

@viralpraxis viralpraxis force-pushed the enhance-naming-method-name-cop-to-detect-offenses-within-data-members branch from bdc0737 to 70e997b Compare July 20, 2025 11:46
@koic koic merged commit 6352fd0 into rubocop:master Jul 20, 2025
24 checks passed
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.

2 participants