-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[flake8-use-pathlib] Add autofix for PTH202
#18763
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
87448bc
[`flake8-use-pathlib`] add autofix for `PTH202`
chirizxc f835f7d
fix: clippy
chirizxc cf5aca8
fix: add `pathlib` import if it needed
chirizxc ba0d9ed
fix: clippy
chirizxc 5b06806
fix: make `FixAvailability` Sometimes
chirizxc 5835c09
doc: add `Fix Safety`
chirizxc d660a4d
fix: fmt
chirizxc aa711cd
fix: doc
chirizxc 78f06ab
chore: more test
chirizxc 5fc55ae
chore: apply review suggestions
chirizxc 56bda9b
Merge remote-tracking branch 'origin/main' into feat/pth202-autofix
chirizxc 453e932
fix
chirizxc 0878808
feat: avoid redundant `Path()`` wrapping in os.path.getsize fix
chirizxc 7d2bf85
chore: add preview
chirizxc 1d6587f
fix: clippy
chirizxc aa94484
fix
chirizxc 695fc84
fix: fmt
chirizxc ab5b2b4
fix: clippy
chirizxc e4c7aab
fix: clippy (x2)
chirizxc aa82460
Update crates/ruff_linter/src/rules/flake8_use_pathlib/rules/os_path_…
ntBre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/ruff_linter/resources/test/fixtures/flake8_use_pathlib/PTH202_2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import os | ||
|
|
||
| os.path.getsize(filename="filename") | ||
| os.path.getsize(filename=b"filename") | ||
| os.path.getsize(filename=__file__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.