mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 20:45:49 +08:00
Enable Ruff flake8-use-pathlib (PTH) (#13795)
Port existing code to pathlib
This commit is contained in:
+3
-3
@@ -54,6 +54,7 @@ select = [
|
||||
"PGH", # pygrep-hooks
|
||||
"PIE", # flake8-pie
|
||||
"PL", # Pylint
|
||||
"PTH", # flake8-use-pathlib
|
||||
"RSE", # flake8-raise
|
||||
"RUF", # Ruff-specific and unused-noqa
|
||||
"SLOT", # flake8-slots
|
||||
@@ -80,9 +81,6 @@ select = [
|
||||
"FURB187", # Use of assignment of `reversed` on list `{name}`
|
||||
# Used for lint.flake8-import-conventions.aliases
|
||||
"ICN001", # `{name}` should be imported as `{asname}`
|
||||
# Autofixable flake8-use-pathlib only
|
||||
"PTH201", # Do not pass the current directory explicitly to `Path`
|
||||
"PTH210", # Invalid suffix passed to `.with_suffix()`
|
||||
# PYI: only enable rules that have autofixes and that we always want to fix (even manually),
|
||||
# avoids duplicate # noqa with flake8-pyi
|
||||
"PYI009", # Empty body should contain `...`, not pass
|
||||
@@ -167,6 +165,8 @@ ignore = [
|
||||
"PLR2004", # Magic value used in comparison, consider replacing `{value}` with a constant variable
|
||||
# Keep codeflow path separation explicit
|
||||
"PLR5501", # Use `elif` instead of `else` then `if`, to reduce indentation
|
||||
# Often just leads to redundant more verbose code when needing an actual str
|
||||
"PTH208", # Use `pathlib.Path.iterdir()` instead.
|
||||
# Allow FIXME
|
||||
"TD001", # Invalid TODO tag: `{tag}`
|
||||
# Git blame is sufficient
|
||||
|
||||
Reference in New Issue
Block a user