mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
[refurb
] Implement math-constant
(FURB152
) (#8727)
## Summary Implements [FURB152](https://github.com/dosisod/refurb/blob/master/docs/checks.md#furb152-use-math-constant) that checks for literals that are similar to constants in `math` module, for example: ```python A = 3.141592 * r ** 2 ``` Use instead: ```python A = math.pi * r ** 2 ``` Related to #1348.
This commit is contained in:
parent
b7dbb9062c
commit
2faac1e7a8
9 changed files with 175 additions and 1 deletions
|
@ -1159,6 +1159,7 @@ mod tests {
|
|||
Rule::TooManyPublicMethods,
|
||||
Rule::UndocumentedWarn,
|
||||
Rule::UnnecessaryEnumerate,
|
||||
Rule::MathConstant,
|
||||
];
|
||||
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue