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

FirstMethodArgumentLineBreak cop doesn't work for super #6974

Closed
AlexWayfer opened this issue Apr 26, 2019 · 2 comments · Fixed by #6976
Closed

FirstMethodArgumentLineBreak cop doesn't work for super #6974

AlexWayfer opened this issue Apr 26, 2019 · 2 comments · Fixed by #6976

Comments

@AlexWayfer
Copy link
Contributor

AlexWayfer commented Apr 26, 2019

Hello!

I've noticed that FirstMethodArgumentLineBreak cop doesn't work for super call.


Expected behavior

Offenses from FirstMethodArgumentLineBreak cop about code with super.

Actual behavior

There are no offenses.

Steps to reproduce the problem

super(:foo,
  :bar
)

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:

$ [bundle exec] rubocop -V
0.67.2 (using Parser 2.6.2.1, running on ruby 2.5.5 x86_64-linux)
koic added a commit to koic/rubocop that referenced this issue Apr 26, 2019
…f calling using `super`

Fixes rubocop#6974.

This PR makes `Layout/FirstMethodArgumentLineBreak` aware of calling using `super`.

```ruby
# example.rb
super(:foo,
  :bar
  )
```

## Before

```console
% rubocop --only Layout/FirstMethodArgumentLineBreak
Inspecting 1 file
.

1 file inspected, no offenses detected
```

## After

```console
% rubocop --only Layout/FirstMethodArgumentLineBreak
Inspecting 1 file
C

Offenses:

example.rb:1:7: C: Layout/FirstMethodArgumentLineBreak: Add a line break
before the first argument of a multi-line method argument list.
super(:foo,
      ^^^^

1 file inspected, 1 offense detected
```
@koic
Copy link
Member

koic commented Apr 26, 2019

Thanks for your feedback. I opened a PR #6976.

@AlexWayfer
Copy link
Contributor Author

Thanks for your feedback. I opened a PR #6976.

Thank you for the work and help!

koic added a commit that referenced this issue Apr 27, 2019
…ware_of_super

[Fix #6974] Make `Layout/FirstMethodArgumentLineBreak` aware of calling using `super`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants