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 Layout/FirstArgumentIndentation for operator methods not called as operators. #9542

Merged
merged 1 commit into from
Feb 27, 2021

Conversation

dvandersluis
Copy link
Member

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:

  • 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.

@dvandersluis
Copy link
Member Author

/cc @TSMMark

@dvandersluis dvandersluis force-pushed the issue/9538 branch 2 times, most recently from 26913df to 4b43051 Compare February 25, 2021 20:24
Copy link
Contributor

@TSMMark TSMMark left a 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?
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

@koic
Copy link
Member

koic commented Feb 26, 2021

This change looks good. Can you squash the commits into one and add the co-authors to the squashed commit message?
https://docs.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors

… as operators.

Co-authored-by: TSMMark <mark.allen@vydia.com>
@mergify mergify bot merged commit 8c20460 into rubocop:master Feb 27, 2021
This was referenced Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants