]> git.lizzy.rs Git - rust.git/commit
Auto merge of #6421 - xFrednet:4176-unreadable-literal-lint-fractal-option, r=Manishearth
authorbors <bors@rust-lang.org>
Sun, 6 Dec 2020 07:18:33 +0000 (07:18 +0000)
committerbors <bors@rust-lang.org>
Sun, 6 Dec 2020 07:18:33 +0000 (07:18 +0000)
commitc1664c50b27a51f7a78c93ba65558e7c33eabee6
treeb23436d5768f212305ff9fab0392144ce3084d04
parent8d678bcd2aea2f27bb005a567a2364b3bf74e9b1
parent898b7c594cfdf1eb56d24a4c6fa02678cf5029a8
Auto merge of #6421 - xFrednet:4176-unreadable-literal-lint-fractal-option, r=Manishearth

Added a lint-fraction-readability flag to the configuration

This adds an option to disable the `unreadable_literal` lint for floats with a longer fraction. This allows users to write `0.100200300` without getting a warning. Fixes #4176

I have some open questions about this PR:
1. I've named the option `lint-fraction-readability` is this a good name or should I rename it to something else?
2. What should the default configuration value be?
    * The current default value is `true` as this was also the previous default.
3. Do I have to document this new option somewhere else or will it be extracted from the code comment?
4. The current fix option will also rewrite the fraction if the integer part violates the `unreadable_literal` lint it would otherwise also trigger the `inconsistent_digit_grouping` lint. Is this also okay?
    * `1.100200300` will be unaffected by the fix function
    * `100200300.100200300` will be effected and fixed to `100_200_300.100_200_300`

---

The project needed some getting used to but I'm happy with the result. A big thank you to `@flip1995` for giving me some pointers for this implementation and to everyone for the great introduction documentation!

---

changelog: Added the `unreadable-literal-lint-fractions` configuration to disable the `unreadable_literal` lint for fractions