-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[flake8-use-pathlib] Make PTH111 fix unsafe because it can change behavior
#20215
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
Conversation
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PTH111 | 74 | 0 | 0 | 0 | 74 |
|
|
I think in that case it's better to offer only diagnostic |
It which? >>> pathlib.Path('.').expanduser()
PosixPath('.')There's nothing to catch unless a genuine ~ exists. |
|
@chirizxc is this ready for review? It sounds like the |
yes |
ntBre
left a comment
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! Just a couple of minor suggestions.
crates/ruff_linter/src/rules/flake8_use_pathlib/rules/os_path_abspath.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/flake8_use_pathlib/rules/os_path_expanduser.rs
Outdated
Show resolved
Hide resolved
## Summary Part of #20215 ## Test Plan
Summary
Fixes #20214
Test Plan