You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's one difference which can be noticed when an implicitly concatenated string is used. F509 looks at the concatenated string while PLE1300 looks at each part of an implicitly concatenated string. Refer to https://play.ruff.rs/6efd9945-2a3b-43e4-b9b7-a8d041b98318.
Yeah, that makes sense but there's one difference where PLE1300 would check each part of an implicitly concatenated string while F509 checks it as a whole. This means that the number of diagnostics would be reduced. That said, I think F509 can be improved to either
Include all the invalid characters in the message or
Raise violation for each invalid character and highlighting the part of the string instead of the entire string
Both rules check for invalid format character in
%
format style string.The implementation is almost the same:
F509
ruff/crates/ruff_linter/src/checkers/ast/analyze/expression.rs
Lines 1087 to 1100 in 1f748b8
PLE1300
ruff/crates/ruff_linter/src/rules/pylint/rules/bad_string_format_character.rs
Lines 117 to 125 in 1f748b8
There's one difference which can be noticed when an implicitly concatenated string is used.
F509
looks at the concatenated string whilePLE1300
looks at each part of an implicitly concatenated string. Refer to https://play.ruff.rs/6efd9945-2a3b-43e4-b9b7-a8d041b98318.Reference:
F509
https://docs.astral.sh/ruff/rules/percent-format-unsupported-format-character/PLE1300
https://docs.astral.sh/ruff/rules/bad-string-format-character/The text was updated successfully, but these errors were encountered: