Skip to content

Commit

Permalink
UP011: Fix typo in rule description (#4306)
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliojargas committed May 9, 2023
1 parent 085fd37 commit e7dfb35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ pub struct LRUCacheWithoutParameters;
impl AlwaysAutofixableViolation for LRUCacheWithoutParameters {
#[derive_message_formats]
fn message(&self) -> String {
format!("Unnecessary parameters to `functools.lru_cache`")
format!("Unnecessary parentheses to `functools.lru_cache`")
}

fn autofix_title(&self) -> String {
"Remove unnecessary parameters".to_string()
"Remove unnecessary parentheses".to_string()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
source: crates/ruff/src/rules/pyupgrade/mod.rs
---
UP011.py:5:21: UP011 [*] Unnecessary parameters to `functools.lru_cache`
UP011.py:5:21: UP011 [*] Unnecessary parentheses to `functools.lru_cache`
|
5 | @functools.lru_cache()
| ^^ UP011
6 | def fixme():
7 | pass
|
= help: Remove unnecessary parameters
= help: Remove unnecessary parentheses

Suggested fix
2 2 | from functools import lru_cache
Expand All @@ -20,14 +20,14 @@ UP011.py:5:21: UP011 [*] Unnecessary parameters to `functools.lru_cache`
7 7 | pass
8 8 |

UP011.py:10:11: UP011 [*] Unnecessary parameters to `functools.lru_cache`
UP011.py:10:11: UP011 [*] Unnecessary parentheses to `functools.lru_cache`
|
10 | @lru_cache()
| ^^ UP011
11 | def fixme():
12 | pass
|
= help: Remove unnecessary parameters
= help: Remove unnecessary parentheses

Suggested fix
7 7 | pass
Expand All @@ -39,15 +39,15 @@ UP011.py:10:11: UP011 [*] Unnecessary parameters to `functools.lru_cache`
12 12 | pass
13 13 |

UP011.py:16:21: UP011 [*] Unnecessary parameters to `functools.lru_cache`
UP011.py:16:21: UP011 [*] Unnecessary parentheses to `functools.lru_cache`
|
16 | @other_decorator
17 | @functools.lru_cache()
| ^^ UP011
18 | def fixme():
19 | pass
|
= help: Remove unnecessary parameters
= help: Remove unnecessary parentheses

Suggested fix
13 13 |
Expand All @@ -59,14 +59,14 @@ UP011.py:16:21: UP011 [*] Unnecessary parameters to `functools.lru_cache`
18 18 | pass
19 19 |

UP011.py:21:21: UP011 [*] Unnecessary parameters to `functools.lru_cache`
UP011.py:21:21: UP011 [*] Unnecessary parentheses to `functools.lru_cache`
|
21 | @functools.lru_cache()
| ^^ UP011
22 | @other_decorator
23 | def fixme():
|
= help: Remove unnecessary parameters
= help: Remove unnecessary parentheses

Suggested fix
18 18 | pass
Expand Down

0 comments on commit e7dfb35

Please sign in to comment.