From a33a7ec06046b4d36214fe4cb102ca82beb253c7 Mon Sep 17 00:00:00 2001 From: mo8it Date: Thu, 2 Nov 2023 19:44:24 +0100 Subject: [PATCH] Apply PTH --- advlabdb/database_import.py | 2 +- cli/setup/generate_secrets/main.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/advlabdb/database_import.py b/advlabdb/database_import.py index dc30349..6b27b16 100644 --- a/advlabdb/database_import.py +++ b/advlabdb/database_import.py @@ -57,7 +57,7 @@ def importFromFile(filePath: Path): groupExperiments = {} appointments = {} - with open(filePath) as f: + with filePath.open() as f: flash("Reading file...") expectingTable = True diff --git a/cli/setup/generate_secrets/main.py b/cli/setup/generate_secrets/main.py index 44b2aa2..d513b8f 100644 --- a/cli/setup/generate_secrets/main.py +++ b/cli/setup/generate_secrets/main.py @@ -12,7 +12,7 @@ def _generate_secrets(): click.echo(f"Skipping secrets generation because the secrets file does already exist at {file}.") return - with open(file, "w") as f: + with file.open("w") as f: f.write("[Secrets]\n") key = secrets.SystemRandom().getrandbits(128) diff --git a/pyproject.toml b/pyproject.toml index d334ec0..eeb53d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.ruff] -select = ["E", "W", "F", "I", "UP", "YTT", "S", "B", "C4", "ICN", "PIE", "Q", "RET", "SIM"] +select = ["E", "W", "F", "I", "UP", "YTT", "S", "B", "C4", "ICN", "PIE", "Q", "RET", "SIM", "TID", "PTH"] ignore = ["E5", "S3", "S6", "RET504"] line-length = 120