-
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
[ruff
] Add rule forbidding map(int, package.__version__.split('.'))
(RUF048
)
#14373
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I wonder if the rule should also flag [int(x) for x in __version__]
and (int(x) for x in __version__)
? But that could always be done as a followup.
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/tuple_map_int_version_parsing.rs
Outdated
Show resolved
Hide resolved
@AlexWaygood Thanks! All fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
ruff
] tuple(map(int, package.__version__.split('.')))
(RUF048
)ruff
] Add rule forbidding map(int, package.__version__.split('.'))
(RUF048
)
Summary
Resolves #12961.
Test Plan
cargo nextest run
andcargo insta test
.