-
-
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 Layout/FirstArgumentIndentation
for operator methods not called as operators.
#9542
Conversation
ad0cbbf
to
60239f5
Compare
/cc @TSMMark |
26913df
to
4b43051
Compare
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.
I added this commit hash ref to Gemfile and tested running rubocop one file and it seems to solve the issue perfectly. Awesome!
@@ -167,6 +167,10 @@ def autocorrect(node) | |||
|
|||
private | |||
|
|||
def bare_operator?(node) | |||
node.operator_method? && !node.dot? |
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.
👏
This change looks good. Can you squash the commits into one and add the co-authors to the squashed commit message? |
… as operators. Co-authored-by: TSMMark <mark.allen@vydia.com>
4b43051
to
559f74f
Compare
Continuation of #9538.
Operators were explicitly allowed by
Layout/FirstArgumentIndentation
, however when an operator method is called as a method (ie. not as a bare operator), the cop should still apply.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.