Enable PTH in ruff
This commit is contained in:
parent
0cb924b3b6
commit
9cc21f5b69
2 changed files with 6 additions and 2 deletions
|
|
@ -135,7 +135,7 @@ os.environ.setdefault("UV_PYTHON_PREFERENCE", "only-managed")
|
|||
|
||||
# Where to keep temporary files (e.g., the constraints file in `install_pinned()`)
|
||||
tempfile.tempdir = ".cache/tmp"
|
||||
os.makedirs(tempfile.tempdir, exist_ok=True)
|
||||
pathlib.Path(tempfile.tempdir).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
@nox.session(name="format", python=MAIN_PYTHON)
|
||||
|
|
@ -318,7 +318,7 @@ def build_docs(session: nox.Session) -> None:
|
|||
# Verify that all external links return 200 OK
|
||||
session.run("sphinx-build", "-b", "linkcheck", DOCS_LOCATION, DOCS_BUILD)
|
||||
|
||||
session.log(f"Docs are available at {os.getcwd()}/{DOCS_BUILD}index.html")
|
||||
session.log(f"Docs are available at {pathlib.Path.cwd()}/{DOCS_BUILD}index.html")
|
||||
|
||||
|
||||
@nox.session(name="venv", python=MAIN_PYTHON, venv_backend="none")
|
||||
|
|
|
|||
|
|
@ -243,6 +243,8 @@ select = [
|
|||
# ========================================
|
||||
# `ruff` only (no working `flake8` plugin)
|
||||
# ========================================
|
||||
# flake8-use-pathlib => `pathlib` instead of `os` functions
|
||||
# "PTH",
|
||||
# pyupgrade => Modern syntax for the targeted Python version
|
||||
# "UP",
|
||||
]
|
||||
|
|
@ -513,6 +515,8 @@ select = [
|
|||
"ICN",
|
||||
# Pylint's refactoring rules => simpler and smaller functions
|
||||
"PLR",
|
||||
# flake8-use-pathlib => `pathlib` instead of `os` functions
|
||||
"PTH",
|
||||
# flake8-print => no `print()`
|
||||
"T20",
|
||||
# pyupgrade => Modern syntax for the targeted Python version
|
||||
|
|
|
|||
Loading…
Reference in a new issue