From 56ef89b2afd61af4f5c19989b83fb786f895bde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Tue, 17 Dec 2024 10:22:50 +0100 Subject: [PATCH 1/2] Remove unused __nonzero__ function --- src/ert/validation/validation_status.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ert/validation/validation_status.py b/src/ert/validation/validation_status.py index 70d2306d02e..88d0148aa66 100644 --- a/src/ert/validation/validation_status.py +++ b/src/ert/validation/validation_status.py @@ -26,8 +26,5 @@ def value(self) -> str | None: def __bool__(self) -> bool: return not self.__fail - def __nonzero__(self) -> bool: - return self.__bool__() - def __str__(self) -> str: return self.__message From 9b35a9196b218dd8543fbfbd95875c6996b08ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Tue, 17 Dec 2024 10:29:48 +0100 Subject: [PATCH 2/2] Add specific exceptions to bad-dunder-names --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cfe295eabf8..1bb65b0fade 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -210,7 +210,6 @@ ignore = [ "PLW1641", # eq-without-hash "PLR0904", # too-many-public-methods "PLR1702", # too-many-nested-blocks - "PLW3201", # bad-dunder-method-name "UP032", # f-string "UP031", # printf-string-formatting ] @@ -230,8 +229,14 @@ allowed-confusables = ["–"] "src/ert/dark_storage/json_schema/__init__.py" = ["F401"] "src/ert/dark_storage/*" = ["RUF029"] # unused-async + [tool.ruff.lint.pylint] max-args = 20 +allow-dunder-method-names = [ + "__default_token__", + "__get_pydantic_core_schema__", + "__get_pydantic_json_schema__", +] [tool.ruff.lint.flake8-bugbear] extend-immutable-calls = [