Skip to content
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

--select=PTH120 does not work #15439

Closed
skraeven opened this issue Jan 12, 2025 · 0 comments · Fixed by #15446
Closed

--select=PTH120 does not work #15439

skraeven opened this issue Jan 12, 2025 · 0 comments · Fixed by #15446
Assignees
Labels
bug Something isn't working

Comments

@skraeven
Copy link

Selecting PTH120 rule seems to always return 0 errors.
The workaround is to drop the 0 (--select=PTH12) to actually get the errors.
I'm not aware of any other rules that has this behavior.

Example:

$ ruff check . --select=PTH120 --isolated
All checks passed!
$ ruff check . --select=PTH12 --isolated
test_pth120.py:3:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent`
  |
1 | import os
2 | 
3 | os.path.dirname("foo/bar/baz")
  | ^^^^^^^^^^^^^^^ PTH120
  |

Found 1 error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants