From 0a4fd0edbc2c962b413e5c25634c059c80e0cb2b Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Mon, 30 Nov 2026 21:31:38 +0100 Subject: [PATCH] Enable PERF in `ruff` --- pyproject.toml | 4 ++++ src/velofy/db/utils/colors.py | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f033c44..7d1e232 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -243,6 +243,8 @@ select = [ # ======================================== # `ruff` only (no working `flake8` plugin) # ======================================== + # Perflint => No performance anti-patterns + # "PERF", # flake8-use-pathlib => `pathlib` instead of `os` functions # "PTH", # pyupgrade => Modern syntax for the targeted Python version @@ -513,6 +515,8 @@ select = [ "I", # flake8-import-conventions => Unified import aliases "ICN", + # Perflint => No performance anti-patterns + "PERF", # Pylint's refactoring rules => simpler and smaller functions "PLR", # flake8-use-pathlib => `pathlib` instead of `os` functions diff --git a/src/velofy/db/utils/colors.py b/src/velofy/db/utils/colors.py index 89ba6b3..15e780f 100644 --- a/src/velofy/db/utils/colors.py +++ b/src/velofy/db/utils/colors.py @@ -31,9 +31,7 @@ def make_random_cmap( for _ in range(n_colors) ] - rgb_colors = [] - for color in hsv_colors: - rgb_colors.append(colorsys.hsv_to_rgb(*color)) + rgb_colors = [colorsys.hsv_to_rgb(*color) for color in hsv_colors] else: low = 0.0