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

Fix an error for InternalAffairs/NodeMatcherDirective when no second argument #13179

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

Earlopain
Copy link
Contributor

There is code below that assumes the existance of two arguments


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.

@@ -103,6 +103,7 @@ def too_many_directives(node)

def process_directive(node, actual_name, directive)
return unless (offense_type = directive_offense_type(directive, actual_name))
return unless node.arguments.count == 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd add a comment explaining this, as it's quite cryptic without one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't even add it add the proper place, oops. Right after on_send it doesn't need one I think but let me know if you still think otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

The intent of the modified code is clearly readable after this comment.

@Earlopain Earlopain force-pushed the node-matcher-directiry-error branch from 56e4567 to fd4f4d7 Compare September 1, 2024 15:14
@koic koic merged commit 9a38b11 into rubocop:master Sep 2, 2024
22 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.

3 participants