Mark `FStringMissingPlaceholders` as fixable (#1582)

This commit is contained in:
Harutaka Kawamura 2023-01-03 12:41:40 +09:00 committed by GitHub
parent afb6f55b8d
commit b351221049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -545,7 +545,7 @@ For more, see [Pyflakes](https://pypi.org/project/pyflakes/2.5.0/) on PyPI.
| F523 | StringDotFormatExtraPositionalArguments | '...'.format(...) has unused arguments at position(s): ... | |
| F524 | StringDotFormatMissingArguments | '...'.format(...) is missing argument(s) for placeholder(s): ... | |
| F525 | StringDotFormatMixingAutomatic | '...'.format(...) mixes automatic and manual numbering | |
| F541 | FStringMissingPlaceholders | f-string without any placeholders | |
| F541 | FStringMissingPlaceholders | f-string without any placeholders | 🛠 |
| F601 | MultiValueRepeatedKeyLiteral | Dictionary key literal repeated | |
| F602 | MultiValueRepeatedKeyVariable | Dictionary key `...` repeated | |
| F621 | ExpressionsInStarAssignment | Too many expressions in star-unpacking assignment | |

View File

@ -3495,6 +3495,7 @@ impl CheckKind {
| CheckKind::DuplicateHandlerException(..)
| CheckKind::EndsInPeriod
| CheckKind::EndsInPunctuation
| CheckKind::FStringMissingPlaceholders
| CheckKind::GetAttrWithConstant
| CheckKind::ImplicitReturn
| CheckKind::ImplicitReturnValue
@ -3622,6 +3623,9 @@ impl CheckKind {
CheckKind::EndsInPeriod => Some("Add period".to_string()),
CheckKind::EndsInPunctuation => Some("Add closing punctuation".to_string()),
CheckKind::ExtraneousScopeFunction => Some("Remove `scope=` argument".to_string()),
CheckKind::FStringMissingPlaceholders => {
Some("Remove extraneous `f` prefix".to_string())
}
CheckKind::GetAttrWithConstant => {
Some("Replace `getattr` with attribute access".to_string())
}