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
Add InternalAffairs/NodeFirstOrLastArgument
cop
#12305
Conversation
4566d69
to
fd65d98
Compare
bd17210
to
81eef26
Compare
changelog/new_add_internal_affairs_node_first_or_last_argument.md
Outdated
Show resolved
Hide resolved
Can you squash your commits into one? |
81eef26
to
0539fec
Compare
0539fec
to
5308f8d
Compare
@@ -0,0 +1 @@ | |||
* [#12305](https://github.com/rubocop/rubocop/pull/12305): Require `rubocop-ast` version 1.30 or greater. ([@sambostock][]) |
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.
Can you rename changelog/new_add_internal_affairs_node_first_or_last_argument.md
to changelog/change_require_rubocop_ast_version_1_30_or_greater.md
?
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.
Done!
This cop checks for `node.arguments.first` and `node.arguments.last`, and corrects them to `node.first_argument` and `node.last_argument`, respectively. Version 1.30 of `rubocop-ast` adds support for `first_argument` on block nodes, and is therefore required for this cop not to produce false positives for those node types.
5308f8d
to
6e22be7
Compare
Seems we were quite consistent even before this change, but I don't mind it. Thanks! |
This cop checks for
node.arguments.first
andnode.arguments.last
, and corrects them tonode.first_argument
andnode.last_argument
, respectively.Motivation for rubocop/rubocop-ast#270.
Before submitting the PR make sure the following are checked:
Commit message starts with[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.