From e9e60318466c730f4ea0bf5756edc742398de38d Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 31 Mar 2025 18:17:42 -0400 Subject: [PATCH] Enable Ruff flake8-use-pathlib (PTH) (autofix only) --- lib/ts_utils/paths.py | 2 +- pyproject.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ts_utils/paths.py b/lib/ts_utils/paths.py index 63119231720d..2894aa24b2d7 100644 --- a/lib/ts_utils/paths.py +++ b/lib/ts_utils/paths.py @@ -5,7 +5,7 @@ # installed into the user's virtual env, so we can't determine the path # to typeshed. Installing ts_utils editable would solve that, see # https://github.com/python/typeshed/pull/12806. -TS_BASE_PATH: Final = Path("") +TS_BASE_PATH: Final = Path() STDLIB_PATH: Final = TS_BASE_PATH / "stdlib" STUBS_PATH: Final = TS_BASE_PATH / "stubs" diff --git a/pyproject.toml b/pyproject.toml index 3cfcddda7b5f..1acc43440d07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,9 @@ select = [ "FURB169", # Compare the identities of `{object}` and None instead of their respective types "FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups "FURB187", # Use of assignment of `reversed` on list `{name}` + # 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