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

Style/EmptyMethod with expanded style autocorrects cause warning #4420

Closed
ofk opened this issue May 25, 2017 · 0 comments
Closed

Style/EmptyMethod with expanded style autocorrects cause warning #4420

ofk opened this issue May 25, 2017 · 0 comments

Comments

@ofk
Copy link

ofk commented May 25, 2017

Expected behavior

The Style/EmptyMethod ( EnforcedStyle: expanded ) cop corrects without warnings.

Actual behavior

It corrects, but it causes Lint/DefEndAlignment warning.

Steps to reproduce the problem

# .rubocop.yml
Style/EmptyMethod:
  EnforcedStyle: expanded
# test.rb
class T
  def m; end
end
$ rubocop -Da
Inspecting 2 files
.W

Offenses:

test.rb:3:3: C: [Corrected] Style/EmptyMethod: Put the end of empty method definitions on the next line.
  def m; end
  ^^^^^^^^^^
test.rb:4:1: W: Lint/DefEndAlignment: end at 4, 0 is not aligned with def at 3, 2.
end
^^^

2 files inspected, 2 offenses detected, 1 offense corrected

RuboCop version

$ rubocop -V
0.49.0 (using Parser 2.4.0.0, running on ruby 2.4.0 x86_64-darwin16)
Drenmi added a commit to Drenmi/rubocop that referenced this issue May 26, 2017
…n auto-correcting

This cop would ignore indentation when auto-correcting compact style
into expanded style, resulting in indentation problems like:

```
class Foo
  def bar
end
end
```

This change fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant