Skip to content

Make Layout/EmptyLineAfterGuardClause accept :nocov: directive after guard clause #12151

@G-Rath

Description

@G-Rath

Is your feature request related to a problem? Please describe.

I expect the cop not the flag the case where the line after the guard clause is a :nocov: directive e.g.

allow(Open3).to receive(:capture3).and_wrap_original do |original_method, *args|
  # :nocov:
  raise "unexpected Open3.capture3 call" unless some_condition
  # :nocov:

  original_method.call(*args)
end

Describe the solution you'd like

I'd like RuboCop to allow the above

Describe alternatives you've considered

Living with this:

allow(Open3).to receive(:capture3).and_wrap_original do |original_method, *args|
  # :nocov:
  raise "unexpected Open3.capture3 call" unless some_condition

  # :nocov:

  original_method.call(*args)
end

Additional context

This is effectively the same as #9146 - I'm happy to do a PR implementing this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy