From 340137fa4cdd2f7945bcaa7aa0aa1a6600a8d11a Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:14:15 +0300 Subject: [PATCH 1/2] Ignore TRY400 globally While the suggestion might be valid in some cases, it doesn't fit all use cases and ends up being a nuisance. --- distutils/_msvccompiler.py | 2 +- ruff.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distutils/_msvccompiler.py b/distutils/_msvccompiler.py index 03653929..e7652218 100644 --- a/distutils/_msvccompiler.py +++ b/distutils/_msvccompiler.py @@ -159,7 +159,7 @@ def _get_vc_env(plat_spec): stderr=subprocess.STDOUT, ).decode('utf-16le', errors='replace') except subprocess.CalledProcessError as exc: - log.error(exc.output) # noqa: RUF100, TRY400 + log.error(exc.output) raise DistutilsPlatformError(f"Error executing {exc.cmd}") env = { diff --git a/ruff.toml b/ruff.toml index 664d894a..370e9cae 100644 --- a/ruff.toml +++ b/ruff.toml @@ -39,6 +39,7 @@ ignore = [ # local "B028", "B904", + "TRY400", ] [format] From aba9eefa8273a86346256dae5b2f565427dc1cab Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:15:58 +0300 Subject: [PATCH 2/2] Clean up ruff ignore --- ruff.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ruff.toml b/ruff.toml index 370e9cae..730732b1 100644 --- a/ruff.toml +++ b/ruff.toml @@ -16,11 +16,7 @@ extend-select = [ "YTT", ] ignore = [ - # local - "PERF203", - "TRY003", - - # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules + # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", "E111", "E114", @@ -39,6 +35,8 @@ ignore = [ # local "B028", "B904", + "PERF203", + "TRY003", "TRY400", ]