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

Cop idea: Check no spaces between . and the method being called #7826

Closed
deivid-rodriguez opened this issue Mar 27, 2020 · 2 comments · Fixed by #7857
Closed

Cop idea: Check no spaces between . and the method being called #7826

deivid-rodriguez opened this issue Mar 27, 2020 · 2 comments · Fixed by #7857
Labels
feature request good first issue Easy task, suitable for newcomers to the project

Comments

@deivid-rodriguez
Copy link
Contributor

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

A. new or Kernel. puts is valid ruby, but very weird.

Describe the solution you'd like

I'd like a cop to enforce that no spaces are used between the . and the method being called. Not sure about naming, perhaps, DotSpacing inspired by the DotPosition cop, or maybe SpaceAfterDot?

Describe alternatives you've considered

None.

Additional context

None.

@deivid-rodriguez deivid-rodriguez changed the title New cop to check no spaces between . and the method being called Cop idea: check no spaces between . and the method being called Mar 27, 2020
@deivid-rodriguez deivid-rodriguez changed the title Cop idea: check no spaces between . and the method being called Cop idea: Check no spaces between . and the method being called Mar 27, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Mar 28, 2020

I'm shocked we didn't write a lint cop about this by now. :-)

@bbatsov bbatsov added feature request good first issue Easy task, suitable for newcomers to the project labels Mar 28, 2020
@deivid-rodriguez
Copy link
Contributor Author

Actually, just found #7273, which wants to check for spaces before the dot, but the cop I'm proposing here is suggested in a followup comment on the issue. So maybe both tickets can be merged 🤷‍♂️

saurabhmaurya15 pushed a commit to saurabhmaurya15/rubocop that referenced this issue Apr 13, 2020
bbatsov pushed a commit that referenced this issue Apr 13, 2020
Co-authored-by: Saurabh Maurya <saurabh.maurya@scripbox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Easy task, suitable for newcomers to the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants