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

EmptyLinesAroundArguments: False positive #9097

Closed
jaredbeck opened this issue Nov 25, 2020 · 0 comments · Fixed by #9103
Closed

EmptyLinesAroundArguments: False positive #9097

jaredbeck opened this issue Nov 25, 2020 · 0 comments · Fixed by #9103
Labels

Comments

@jaredbeck
Copy link
Contributor

Input

# frozen_string_literal: true

def execute
  ::Redacted.
    redacted(@redacted).
    redacted2(@redacted2).
    redacted3(redacted).

    # redacted
    # redacted
    # blank lines help the reader understand that these comments pertain only to
    # the one following method call (`references`)
    # redacted
    # redacted
    references(:redacted, :redacted2, :redacted3, :redacted4, :redacted5).

    redacted4(redacted2).
    redacted5(@redacted3).
    redacted6(redacted: true)
end

Expected behavior

No offenses expected

Actual behavior

bin/rubocop input.rb
Inspecting 1 file
C

Offenses:

input.rb:16:1: C: Layout/EmptyLinesAroundArguments: Empty line detected around arguments.

1 file inspected, 1 offense detected, 1 offense auto-correctable

Steps to reproduce the problem

See input above.

RuboCop version

bundle exec rubocop -V
1.4.2 (using Parser 2.7.2.0, rubocop-ast 1.2.0, running on ruby 2.6.6 x86_64-darwin19)
  - rubocop-rails 2.8.1
  - rubocop-rspec 2.0.0
@koic koic added the bug label Nov 26, 2020
koic added a commit to koic/rubocop that referenced this issue Nov 26, 2020
…rguments`

Fixes rubocop#9097.

This PR fixes a false positive for `Layout/EmptyLinesAroundArguments`
when blank line is inserted between method with arguments and receiver.
bbatsov pushed a commit that referenced this issue Nov 26, 2020
Fixes #9097.

This PR fixes a false positive for `Layout/EmptyLinesAroundArguments`
when blank line is inserted between method with arguments and receiver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants