-
-
Notifications
You must be signed in to change notification settings - Fork 285
Fix offenses for InternalAffairs/NodePatternGroups cop #2114
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
Conversation
|
We need |
| node.str_type? | ||
| end | ||
|
|
||
| def symbol?(node) |
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.
Maybe we should inline #string? and #symbol? now? They are only used once each.
This cop was added by the following PR. - rubocop/rubocop#13762 ``` Offenses: lib/rubocop/cop/rspec/context_wording.rb:70:63: C: [Corrected] InternalAffairs/NodePatternGroups: Replace str, dstr, xstr in node pattern union with any_str. (block (send #rspec? { :context :shared_context } $({str dstr xstr} ...) ...) ...) ^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/mixin/final_end_location.rb:10:34: C: [Corrected] InternalAffairs/NodeTypeGroup: Use :any_str instead of individually listing group types. start_node.each_node(:str, :dstr, :xstr) ^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/mixin/variable.rb:16:15: C: [Corrected] InternalAffairs/NodePatternGroups: Replace sym, dsym in node pattern union with any_sym. $({sym str dsym dstr} ...) ...) ^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/predicate_matcher.rb:184:36: C: [Corrected] Style/SymbolProc: Pass &:any_str_type? as an argument to select instead of a block. matcher.arguments.select do |arg| ... ^^^^^^^^ lib/rubocop/cop/rspec/predicate_matcher.rb:185:23: C: [Corrected] InternalAffairs/NodeTypeGroup: Use :any_str instead of individually listing group types. arg.type?(:str, :dstr, :xstr) ^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/sort_metadata.rb:33:28: C: [Corrected] InternalAffairs/NodePatternGroups: Replace str, dstr, xstr in node pattern union with any_str. (send _ _ _ ... !{hash sym str dstr xstr}) ^^^^^^^^^^^^^^^^^^^^^^^^ lib/rubocop/cop/rspec/variable_definition.rb:72:22: C: [Corrected] InternalAffairs/NodeTypeGroup: Use :any_sym instead of individually listing group types. node.type?(:sym, :dsym) ^^^^^^^^^^^ 282 files inspected, 7 offenses detected, 7 offenses corrected ```
| ## Master (Unreleased) | ||
|
|
||
| - Add new cop `RSpec/LeakyLocalVariable`. ([@lovro-bikic]) | ||
| - Bump RuboCop requirement to +1.81. ([@ydah]) |
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.
memo) added change log
Fix offenses for InternalAffairs/NodePatternGroups cop
This cop was added by the following PR.
InternalAffairs/NodePatternGroupscop rubocop#13762Before submitting the PR make sure the following are checked:
master(if not - rebase it).CHANGELOG.mdif the new code introduces user-observable changes.bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).