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

ClassAndModuleChildren compact syntax false negative when outer module is already nested #9761

Closed
mockdeep opened this issue May 3, 2021 · 0 comments · Fixed by #9765
Closed
Assignees
Labels

Comments

@mockdeep
Copy link
Contributor

mockdeep commented May 3, 2021

When using the ClassAndModuleChildren rule with EnforcedStyle: compact, it does not report violations when the outer module is already nested:

module Foo::Bar
  class Baz
  end
end

Expected behavior

The above would report a violation. It should require:

class Foo::Bar::Baz
end

Actual behavior

It does not report a violation.

Steps to reproduce the problem

See above.

RuboCop version

1.13.0 (using Parser 3.0.1.0, rubocop-ast 1.4.1, running on ruby 3.0.1 x86_64-linux)
  - rubocop-rails 2.9.1
  - rubocop-rspec 2.3.0
@dvandersluis dvandersluis self-assigned this May 3, 2021
dvandersluis added a commit to dvandersluis/rubocop that referenced this issue May 3, 2021
…for `compact` style when a class/module is partially nested.
bbatsov pushed a commit that referenced this issue May 4, 2021
…mpact` style when a class/module is partially nested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants