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

Valid use of private generates offense #3120

Closed
craiglittle opened this issue May 10, 2016 · 0 comments
Closed

Valid use of private generates offense #3120

craiglittle opened this issue May 10, 2016 · 0 comments
Labels

Comments

@craiglittle
Copy link

craiglittle commented May 10, 2016

Expected behavior

Uses of private within a class defined using Class.new should not generate a Useless private access modifier. offense.

Actual behavior

A Useless private access modifier. offense is generated.

Steps to reproduce the problem

When I run v0.40.0 against the master branch of the biz gem, I get the following output:

Running RuboCop...
Inspecting 80 files
.......W........................................................................

Offenses:

lib/biz/calculation/for_duration.rb:66:15: W: Useless private access modifier.
              private
              ^^^^^^^
lib/biz/calculation/for_duration.rb:95:15: W: Useless private access modifier.
              private
              ^^^^^^^

Here's the section of the code causing the erroneous offenses.

RuboCop version

>> rubocop -V
0.40.0 (using Parser 2.3.1.0, running on ruby 2.3.0 x86_64-darwin15)

Hope that's helpful! Let me know if I can provide any other details.

@bbatsov bbatsov added the bug label May 10, 2016
owst added a commit to owst/rubocop that referenced this issue May 11, 2016
Blocks passed to {Class,Module,Struct}.new create a new scope, in a
similar way to Klass.class_eval.
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
Blocks passed to {Class,Module,Struct}.new create a new scope, in a
similar way to Klass.class_eval.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants