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

No cop checking for space after (or within) block arguments? #1627

Closed
bquorning opened this issue Feb 3, 2015 · 3 comments
Closed

No cop checking for space after (or within) block arguments? #1627

bquorning opened this issue Feb 3, 2015 · 3 comments
Assignees

Comments

@bquorning
Copy link
Contributor

[].each { |x|puts x }

I cannot find an existing cop that would complain about the missing space after |x|.

I am thinking that perhaps this should be a responsibility of the SpaceInsideBlockBraces cop, or – since that cop is maybe growing too large – if there should be a new SpaceAroundBlockArguments cop that checks the spacing on both sides of the |x|.

@bquorning
Copy link
Contributor Author

Maybe the spacing inside the arguments “block” could be checked by the same cop. In the following example, there should be only one space after the comma, and no space before x and after y:

{}.each { | x,  y |puts x }

@bquorning bquorning changed the title No cop checking for space after block argument? No cop checking for space after (or within) block arguments? Feb 3, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Feb 3, 2015

I agree it'd be great if we had both checks. Guess @jonas054 can look into implementing them.

@jonas054 jonas054 self-assigned this Feb 3, 2015
@jonas054
Copy link
Collaborator

jonas054 commented Feb 3, 2015

Sure.

bbatsov added a commit that referenced this issue Feb 5, 2015
…eters

[Fix #1627] New cop SpaceAroundBlockParameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants