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

Doesn't remove space from %w array #3058

Closed
guyisra opened this issue Apr 19, 2016 · 3 comments
Closed

Doesn't remove space from %w array #3058

guyisra opened this issue Apr 19, 2016 · 3 comments

Comments

@guyisra
Copy link

guyisra commented Apr 19, 2016

for an array defined like
%w( 2016-04-01 2016-03-01 2016-02-01 2016-01-01)

Rubocop won't fix the initial space (or add a space at the end)

Using latest rubocop

@jonas054
Copy link
Collaborator

I think the best solution is to add a new cop for space in %w/%W literals, and one for %i/%I.

@Drenmi
Copy link
Collaborator

Drenmi commented Apr 25, 2016

@jonas054: Do you think it would be acceptable with a single cop for both types of word array (%w and %i)? Since most of the functionality will be duplicated. For example Style/SpaceInsideWordArray? (Arguably, Style/SpaceInsideBrackets should be named Style/SpaceInsideArrayLiteral. 😀 )

Also, do we want to include a configuration option to enforce spaces? I.e.:

%w( 2016-04-01 2016-03-01 2016-02-01 2016-01-01 )

@jonas054
Copy link
Collaborator

jonas054 commented May 4, 2016

Yes, that would be acceptable IMO. And let's only enforce "no space", and maybe add the configuration option later if there's a demand.

owst added a commit to owst/rubocop that referenced this issue Jun 19, 2016
Add `Style/SpaceInsideArrayPercentLiteral` and
`Style/SpaceInsidePercentLiteralDelimiters`
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…op#3214)

Add `Style/SpaceInsideArrayPercentLiteral` and
`Style/SpaceInsidePercentLiteralDelimiters`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants