[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:
Tuomas Siipola 2023-11-17 19:37:44 +02:00 committed by GitHub
parent b7dbb9062c
commit 2faac1e7a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 175 additions and 1 deletions

View file

@ -1159,6 +1159,7 @@ mod tests {
Rule::TooManyPublicMethods,
Rule::UndocumentedWarn,
Rule::UnnecessaryEnumerate,
Rule::MathConstant,
];
#[allow(clippy::needless_pass_by_value)]