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

New cop: Layout/SpaceAroundSingletonInheritence #8469

Closed
alex-damian-negru opened this issue Aug 6, 2020 · 1 comment
Closed

New cop: Layout/SpaceAroundSingletonInheritence #8469

alex-damian-negru opened this issue Aug 6, 2020 · 1 comment
Labels

Comments

@alex-damian-negru
Copy link

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

One could write

class<<self

which isn't as readable as adding spaces around the << operator:

class << self

Describe the solution you'd like

There should be a layout cop that checks whether there are spaces around the << operator for singleton class inheritence.

Describe alternatives you've considered

Additional context

jonas054 added a commit to jonas054/rubocop that referenced this issue Jul 3, 2021
I chose the name SpaceAroundSingletonClassOperator rather than
SpaceAroundSingletonInheritence, which was suggested in the feature
request. Although I'm not sure that << is actually an operator, I am pretty
sure that inheritance is not involved. The operator (for lack of a better term)
opens up the singleton class, or eigenclass, so methods can be added to it.
@jonas054
Copy link
Collaborator

jonas054 commented Jul 4, 2021

As per the discussion in #9906 we view the missing inspection as a bug.

@koic koic closed this as completed in abb9032 Jul 4, 2021
koic added a commit that referenced this issue Jul 4, 2021
[Fix #8469] Add singleton class operator inspection
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