-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
#9549
Merged
koic
merged 1 commit into
rubocop:master
from
koic:fix_error_for_internal_affairs_node_matcher_directive
Feb 27, 2021
Merged
Fix an error for InternalAffairs/NodeMatcherDirective
#9549
koic
merged 1 commit into
rubocop:master
from
koic:fix_error_for_internal_affairs_node_matcher_directive
Feb 27, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR fixes the following error for `InternalAffairs/NodeMatcherDirective`. ```console % cat example.rb def_node_matcher :foo?, format(PATTERN, type: 'const') % bundle exec rubocop --only InternalAffairs/NodeMatcherDirective -d (snip) Inspecting 1 file Scanning /Users/koic/src/github.com/koic/rubocop-issues/ia_cop/example.rb An error occurred while InternalAffairs/NodeMatcherDirective cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/ia_cop/example.rb:1:0. undefined method `value' for s(:send, nil, :format, s(:const, nil, :PATTERN), s(:hash, s(:pair, s(:sym, :type), s(:str, "const")))):RuboCop::AST::SendNode /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb:100:in `insert_directive' /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb:85:in `block in register_offense' (snip) 1 error occurred: An error occurred while InternalAffairs/NodeMatcherDirective cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/ia_cop/example.rb:1:0. Errors are usually caused by RuboCop bugs. Please, report your problems to RuboCop's issue tracker. https://github.com/rubocop/rubocop/issues ```
dvandersluis
approved these changes
Feb 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No matter how many times I tried it of course I missed something 😅
thanks @koic!
This was referenced Mar 6, 2021
Closed
This was referenced Mar 15, 2021
This was referenced Mar 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the following error for
InternalAffairs/NodeMatcherDirective
.Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.