Correct UP027 message to “generator expression” (#1540)

This commit is contained in:
Anders Kaseorg 2023-01-01 15:30:58 -08:00 committed by GitHub
parent 31ce37dd8e
commit 86b61806a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -689,7 +689,7 @@ For more, see [pyupgrade](https://pypi.org/project/pyupgrade/3.2.0/) on PyPI.
| UP024 | OSErrorAlias | Replace aliased errors with `OSError` | 🛠 |
| UP025 | RewriteUnicodeLiteral | Remove unicode literals from strings | 🛠 |
| UP026 | RewriteMockImport | `mock` is deprecated, use `unittest.mock` | 🛠 |
| UP027 | RewriteListComprehension | Replace unpacked list comprehension with a tuple comprehension | 🛠 |
| UP027 | RewriteListComprehension | Replace unpacked list comprehension with a generator expression | 🛠 |
### pep8-naming (N)

View file

@ -2742,7 +2742,7 @@ impl CheckKind {
"`mock` is deprecated, use `unittest.mock`".to_string()
}
CheckKind::RewriteListComprehension => {
"Replace unpacked list comprehension with a tuple comprehension".to_string()
"Replace unpacked list comprehension with a generator expression".to_string()
}
// pydocstyle
CheckKind::FitsOnOneLine => "One-line docstring should fit on one line".to_string(),
@ -3331,7 +3331,7 @@ impl CheckKind {
MockReference::Attribute => "Replace `mock.mock` with `mock`".to_string(),
}),
CheckKind::RewriteListComprehension => {
Some("Replace with tuple comprehension".to_string())
Some("Replace with generator expression".to_string())
}
CheckKind::NewLineAfterSectionName(name) => {
Some(format!("Add newline after \"{name}\""))