Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Dec 27, 2023
1 parent 1297339 commit 934cd11
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/refurb/FURB152.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@
e = 2.71824 # OK

e = 2.71820001 # OK

e = 2.718200000000001 # OK

e = 2.7182000000000001 # FURB152
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,25 @@ FURB152.py:35:5: FURB152 [*] Replace `2.7183` with `math.e`
37 38 | e = 2.719 # OK
38 39 |

FURB152.py:45:5: FURB152 [*] Replace `2.7182000000000001` with `math.e`
|
43 | e = 2.718200000000001 # OK
44 |
45 | e = 2.7182000000000001 # FURB152
| ^^^^^^^^^^^^^^^^^^ FURB152
|
= help: Use `math.e`

Safe fix
1 |+import math
1 2 | r = 3.1 # OK
2 3 |
3 4 | A = 3.14 * r ** 2 # FURB152
--------------------------------------------------------------------------------
42 43 |
43 44 | e = 2.718200000000001 # OK
44 45 |
45 |-e = 2.7182000000000001 # FURB152
46 |+e = math.e # FURB152


0 comments on commit 934cd11

Please sign in to comment.