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

Allow WordArray to support a minimum array size #603

Merged
merged 1 commit into from
Nov 4, 2013

Conversation

claco
Copy link
Contributor

@claco claco commented Nov 3, 2013

Sometimes it is preferred to use an array for a small number of strings
and only force the use of %w %W when the item count it large. This
allows the WordArray style to only complain if the number of string
elements are over the set minimum.

Not entirely sure about the setting name. MinSize seems fitting.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling bd99beb2db8dba43bb0ba519e15b89755e25c7b0 on claco:word-arrsy-max into 62344d4 on bbatsov:master.

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 3, 2013

I'm OK with the proposed change. You'll also have to update the changelog and the default.yml before this can be merged.

@claco
Copy link
Contributor Author

claco commented Nov 3, 2013

Should I remove the || 0 from the code then?

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 3, 2013

Yep. Normally we don't rely on implicit defaults.

@claco
Copy link
Contributor Author

claco commented Nov 4, 2013

It looks like the specs don't use default.yml. Is that right? So even with a default set, I still have to supply the default in the word array spec itself correct?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling d65d39ae1db26ddd22465057d4654f151163ee03 on claco:word-arrsy-max into 62344d4 on bbatsov:master.

@jonas054
Copy link
Collaborator

jonas054 commented Nov 4, 2013

@claco Yes, that's correct.

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2013

@claco You forgot to update the CHANGELOG.md :-)

@claco
Copy link
Contributor Author

claco commented Nov 4, 2013

Don't you worry bout that. :-)

Sometimes it is preferred to use an array for a small number of strings
and only force the use of %w %W when the item count it large. This
allows the WordArray style to only complain if the number of string
elements are over the set minimum.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) when pulling 0a6032b on claco:word-arrsy-max into fec1368 on bbatsov:master.

bbatsov added a commit that referenced this pull request Nov 4, 2013
Allow WordArray to support a minimum array size
@bbatsov bbatsov merged commit d876c6a into rubocop:master Nov 4, 2013
@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2013

Thanks!

@claco
Copy link
Contributor Author

claco commented Nov 5, 2013

lolz. no clue why my github handle isn't rendering in Changelog.

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

Successfully merging this pull request may close these issues.

4 participants