From aeebffef162ec105918b4001005c1c2b5b0cfeea Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 2 Aug 2024 16:07:45 -0400 Subject: [PATCH] pyproject remove unused ruff ignores --- pyproject.toml | 10 ---------- src/qtoolkit/core/data_objects.py | 4 ++-- src/qtoolkit/host/local.py | 2 +- tests/io/test_shell.py | 1 + tests/io/test_slurm.py | 2 ++ 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1ac0168..7530076 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,6 @@ ignore = [ "ANN", # TODO fix all ANN errors "ARG", # TODO fix unused method argument "BLE001", - "C408", # Unnecessary (dict/list/tuple) call - remove call "C901", # function too complex "COM812", # trailing comma missing "D", @@ -89,10 +88,8 @@ ignore = [ "G004", # logging uses fstring "ISC001", "N802", # TODO maybe fix these - "PD011", # pandas-use-of-dot-values "PERF203", # try-except-in-loop "PGH003", - "PLR0911", # too many returns "PLR0912", # too many branches "PLR0913", # too many arguments "PLR0915", # too many statements @@ -102,14 +99,7 @@ ignore = [ "PT013", # pytest-incorrect-pytest-import "PTH", # prefer Pathlib to os.path "RUF013", # implicit-optional - "S106", - "S110", - "S311", - "S324", # use of insecure hash function - "S507", # paramiko auto trust - "S602", "SIM105", # contextlib.suppress(Exception) instead of try-except - "SLF", # private member accessed outside class "T201", # print statement "TD", # TODOs "TRY003", # long message outside exception class diff --git a/src/qtoolkit/core/data_objects.py b/src/qtoolkit/core/data_objects.py index 3e5df41..28890da 100644 --- a/src/qtoolkit/core/data_objects.py +++ b/src/qtoolkit/core/data_objects.py @@ -103,12 +103,12 @@ def __new__(cls, *values): obj._value_ = values[0] for other_value in values[1:]: cls._value2member_map_[other_value] = obj - obj._all_values = values + obj._all_values = values # noqa: SLF001 return obj def __repr__(self): return "<{}.{}: {}>".format( - self.__class__.__name__, + type(self).__name__, self._name_, ", ".join([repr(v) for v in self._all_values]), ) diff --git a/src/qtoolkit/host/local.py b/src/qtoolkit/host/local.py index 4128818..8437f5f 100644 --- a/src/qtoolkit/host/local.py +++ b/src/qtoolkit/host/local.py @@ -35,7 +35,7 @@ def execute(self, command: str | list[str], workdir: str | Path | None = None): command = " ".join(command) workdir = str(workdir) if workdir else Path.cwd() with cd(workdir): - proc = subprocess.run(command, capture_output=True, shell=True, check=False) + proc = subprocess.run(command, capture_output=True, shell=True, check=False) # noqa: S602 return proc.stdout.decode(), proc.stderr.decode(), proc.returncode def mkdir(self, directory, recursive=True, exist_ok=True) -> bool: diff --git a/tests/io/test_shell.py b/tests/io/test_shell.py index 61ffa07..e8f6a93 100644 --- a/tests/io/test_shell.py +++ b/tests/io/test_shell.py @@ -1,3 +1,4 @@ +# ruff: noqa: SLF001 import pytest try: diff --git a/tests/io/test_slurm.py b/tests/io/test_slurm.py index cd51cd4..d09fd00 100644 --- a/tests/io/test_slurm.py +++ b/tests/io/test_slurm.py @@ -1,3 +1,5 @@ +# ruff: noqa: SLF001 + from datetime import timedelta from pathlib import Path