Skip to content

[flake8-use-pathlib] Fix false negative on direct Path() instantiation (PTH210) #19388

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 3 commits into from
Jul 16, 2025

Conversation

danparizher
Copy link
Contributor

Summary

Fixes #19329

Copy link
Contributor

github-actions bot commented Jul 16, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre added bug Something isn't working rule Implementing or modifying a lint rule labels Jul 16, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I just had one simplification suggestion by using the typing trait method.

@ntBre ntBre changed the title [flake8_use_pathlib] Fix false negative for PTH210 on direct Path() instantiation with with_suffix [flake8-use-pathlib] Fix false negative on direct Path() instantiation (PTH210) Jul 16, 2025
@ntBre ntBre enabled auto-merge (squash) July 16, 2025 20:40
@ntBre ntBre merged commit 029de78 into astral-sh:main Jul 16, 2025
34 checks passed
@danparizher danparizher deleted the fix-19329 branch July 16, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False negative for invalid-pathlib-with-suffix (PTH210) if method called on direct instantiation
2 participants