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
Closed

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

deivid-rodriguez opened this issue Mar 27, 2020 · 2 comments

Comments

@deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Mar 27, 2020

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 bbatsov commented Mar 28, 2020

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

@deivid-rodriguez
Copy link
Contributor Author

@deivid-rodriguez deivid-rodriguez commented Mar 28, 2020

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 7, 2020
saurabhmaurya15 pushed a commit to saurabhmaurya15/rubocop that referenced this issue Apr 7, 2020
saurabhmaurya15 pushed a commit to saurabhmaurya15/rubocop that referenced this issue Apr 10, 2020
saurabhmaurya15 pushed a commit to saurabhmaurya15/rubocop that referenced this issue Apr 11, 2020
saurabhmaurya15 pushed a commit to saurabhmaurya15/rubocop that referenced this issue Apr 11, 2020
saurabhmaurya15 pushed a commit to saurabhmaurya15/rubocop that referenced this issue Apr 12, 2020
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>
Neodelf added a commit to Neodelf/rubocop that referenced this issue Apr 28, 2020
…cop (rubocop-hq#7857)

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.