From b32f29e5bfe86a9b42fbe52089a2705ef5393616 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 10 Nov 2026 14:07:40 -0500 Subject: [PATCH] PYTHON-6239 Enable ruff FURB rules --- pyproject.toml | 1 - test/asynchronous/test_async_loop_unblocked.py | 2 +- tools/synchro.py | 17 +++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5999f0c58d..c1cc282c6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -247,7 +247,6 @@ ignore = [ "ICN001", # Use standard import naming conventions (pandas as pd, datetime as dt...) # These are all new defaults added in ruff 0.16.0. Individual tickets linked from PYTHON-5964 track enabling each one. "BLE", # flake8-blind-except - "FURB", # refurb "LOG", # flake8-logging "PERF", # Perflint "PYI", # flake8-pyi diff --git a/test/asynchronous/test_async_loop_unblocked.py b/test/asynchronous/test_async_loop_unblocked.py index 7f3f97ae44..65b8027d62 100644 --- a/test/asynchronous/test_async_loop_unblocked.py +++ b/test/asynchronous/test_async_loop_unblocked.py @@ -51,7 +51,7 @@ async def background_task(): await t self.assertLessEqual( - sorted(latencies, reverse=True)[0], + max(latencies), 1.0, "Background task was blocked from running", ) diff --git a/tools/synchro.py b/tools/synchro.py index 4d2f865479..f5b6260b5d 100644 --- a/tools/synchro.py +++ b/tools/synchro.py @@ -418,14 +418,15 @@ def main() -> None: for f in generated_files: print(f" {f}") - subprocess.run( # noqa: S603 - [sys.executable, "-m", "ruff", "check", *generated_files, "--fix", *ruff_extra], - check=is_ci, - ) - subprocess.run( # noqa: S603 - [sys.executable, "-m", "ruff", "format", *generated_files, *ruff_extra], - check=is_ci, - ) + if generated_files: + subprocess.run( # noqa: S603 + [sys.executable, "-m", "ruff", "check", *generated_files, "--fix", *ruff_extra], + check=is_ci, + ) + subprocess.run( # noqa: S603 + [sys.executable, "-m", "ruff", "format", *generated_files, *ruff_extra], + check=is_ci, + ) if is_ci and generated_files: result = subprocess.run( # noqa: S603