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

Add rules for hexadecimal, binary and decimal literal prefixes #579

Merged
merged 1 commit into from
Jun 15, 2016

Conversation

tejasbubane
Copy link
Contributor

Related to #578

@bbatsov suggested to add rule for hex numbers. I went ahead and added
one for binary as well.

@cremno
Copy link

cremno commented Jun 6, 2016

There's also the rather pointless 0d/0D prefix. I also think this can be condensed into one rule. Having 3 or even 4 very similar sections is kinda ugly.

@tejasbubane tejasbubane force-pushed the hex-binary-literals branch 3 times, most recently from f1dacd0 to f1e6bb0 Compare June 6, 2016 09:43
@tejasbubane
Copy link
Contributor Author

@cremno Thanks! Did not know about the 0d prefix. I have added it but since it is pointless, not sure if we should keep it.

And yes, the 4 very similar sections looked kinda ugly. I have combined them into a single section.

@cremno
Copy link

cremno commented Jun 6, 2016

I think you've misunderstood me. The following would make sense to me:

  • use 0[bodx] instead of 0[BODX]
  • use 0o instead of 0 (like now but minus 0O - it doesn't matter anyway if it's 00 or 0O)

And maybe (@bbatsov?):

  • don't use 0d

@tejasbubane
Copy link
Contributor Author

0[bodx] looks a little confusing to me.

@cremno
Copy link

cremno commented Jun 6, 2016

My comment is just an example of how I would arrange the sections. I didn't want to propose anything in it as official wording or criticize yours.

@tejasbubane
Copy link
Contributor Author

@cremno Yes, I understand. I just felt it a little confusing. Let's see what @bbatsov has to say.

Related to rubocop#578

@bbatsov suggested to add rule for hex numbers. I went ahead and added
one for binary as well.
@tejasbubane tejasbubane changed the title Add rules for hexadecimal and binary literals Add rules for hexadecimal, binary and decimal literal prefixes Jun 13, 2016
@tejasbubane tejasbubane force-pushed the hex-binary-literals branch from f1e6bb0 to 3775216 Compare June 13, 2016 08:14
@bbatsov bbatsov merged commit 496afeb into rubocop:master Jun 15, 2016
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 15, 2016

Looks good to me.

pocke pushed a commit to pocke/ruby-style-guide that referenced this pull request Feb 7, 2017
Related to rubocop#578

@bbatsov suggested to add rule for hex numbers. I went ahead and added
one for binary as well.
ellimist pushed a commit to ellimist/ruby-style-guide that referenced this pull request Mar 15, 2017
Related to rubocop#578

@bbatsov suggested to add rule for hex numbers. I went ahead and added
one for binary as well.
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.

3 participants