diff --git a/crates/ruff/src/rules/pylint/rules/bad_string_format_character.rs b/crates/ruff/src/rules/pylint/rules/bad_string_format_character.rs index 39fd1c4b34..6639fb95ce 100644 --- a/crates/ruff/src/rules/pylint/rules/bad_string_format_character.rs +++ b/crates/ruff/src/rules/pylint/rules/bad_string_format_character.rs @@ -19,8 +19,7 @@ use crate::checkers::ast::Checker; /// Checks for unsupported format types in format strings. /// /// ## Why is this bad? -/// The format string is not checked at compile time, so it is easy to -/// introduce bugs by mistyping the format string. +/// An invalid format string character will result in an error at runtime. /// /// ## Example /// ```python @@ -41,6 +40,7 @@ impl Violation for BadStringFormatCharacter { } } +/// PLE1300 /// Ex) `"{:z}".format("1")` pub(crate) fn call(checker: &mut Checker, string: &str, range: TextRange) { if let Ok(format_string) = FormatString::from_str(string) { @@ -64,6 +64,7 @@ pub(crate) fn call(checker: &mut Checker, string: &str, range: TextRange) { } } +/// PLE1300 /// Ex) `"%z" % "1"` pub(crate) fn percent(checker: &mut Checker, expr: &Expr) { // Grab each string segment (in case there's an implicit concatenation).