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

Bug/Feature Request: Breakout of Style/AccessModifierDeclaration false positives (#5953) #11910

Closed
luke-hill opened this issue Jun 1, 2023 · 1 comment

Comments

@luke-hill
Copy link

This is a breakout / re-opening of the old ticket. Specifically to fix the "main" use issue. (Non def defined methods shouldn't trip this up).

Expected behavior

None def defined methods should not trip this up. As an example the below code should be permissible - as it's the most common style

class Foo
  attr_reader :baz
  private :baz

  def initialize(baz)
    @baz = baz
  end

  private

  # ten_other_methods
end

Actual behavior

Same as prior to #5953 (Rubocop 0.x series)

Steps to reproduce the problem

Write the code as provided above

RuboCop version

Latest rubocop

@luke-hill
Copy link
Author

EDIT: This does seem fixed in the latest version of rubocop. But not from the OP. So I'm going to close this as completed "at some point". I tried using rubocop 1.50+ and the cop offense isn't flagging for the above code example.

Tagging @koic for visibility

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