-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule duplication F509
and PLE1300
#11403
Comments
@dhruvmanila - Let's remove |
See #9756 for prior art. |
Yeah, that makes sense but there's one difference where
|
I'm looking into this and it seems that there's one behavior which is different - |
Shouldn't they be aliased to match what's expected from each tool and not break rétro compatibility ? (There's another issue for human readable names where old_names from pylint and aliases came up). |
Yeah, sorry, I meant that |
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: