rubocop / rubocop

A Ruby static code analyzer and formatter, based on the community Ruby style guide.

Home Page:https://docs.rubocop.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Split "ClassAndModuleChildren" rule in 2 rules

WaKeMaTTa opened this issue · comments

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

In my company we use this rules:

  • Use always plural for namespaces. This namespaces need to be Modules.
  • Use always singular for object. This object need to be Classes.

The result is:

module Companies::Products
  class TagService
  end
end

Then then rubocop is always complaying. The rubocop rule that complains is ClassAndModuleChildren

Describe the solution you'd like

I would like to split the rubocop rule Style/ClassAndModuleChildren in 2.

Having Style/ClassChildren and Style/ModuleChildren, it would allow me to define it this way:

Style/ModuleChildren:
  EnforcedStyle: "compact"
Style/ClassChildren:
  EnforcedStyle: "nested"