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

Adding a new rule: Underscore numeric literals. #1285

Closed
wants to merge 1 commit into from

Conversation

nexsja
Copy link

@nexsja nexsja commented Nov 15, 2021

Description

Added a new rule for numeric literals: numeric literals should be chunked in 3s and delimited with a _.

Checklist

  • tests are added
  • CHANGELOG.md is updated

- All numeric literals should be delimited with a `_` for increased readibility.
@nexsja nexsja force-pushed the underscore-numeric-literals branch from 5db68b4 to 72d015d Compare November 15, 2021 13:18
@romtsn
Copy link
Collaborator

romtsn commented Nov 15, 2021

Thanks for the PR, but I think we cannot accept it as part of the standard ruleset (at best - experimental), as no such convention exists in https://kotlinlang.org/docs/coding-conventions.html. The rule also can be considered highly opinionated - we will discuss whether we introduce a new contrib ruleset, if yes, this can definitely be part of it

@nexsja
Copy link
Author

nexsja commented Nov 15, 2021

Fair enough, thanks for the feedback. :)

If you do decide to add this to any other ruleset - I don't mind finishing up whatever's necessary. Thanks! :)

@shashachu
Copy link
Contributor

@nexsja we've considered having some sort of repo or ruleset with community-contributed rules, but it doesn't actually make a lot of sense right now to host them all into a single ruleset, since it's very unlikely any developer would want all of them. We would need to introduce the idea of code style sets (#548) in order for something like this to make sense. But thanks for the contribution! I encourage you to host this rule in your own repo. :)

@shashachu shashachu closed this Nov 30, 2021
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