From 0d7ba8faa6a2a423a0772a01f381ee5ba7d371dc Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:29:09 +0100 Subject: [PATCH] Enable the entire PERF category in Ruff --- .ruff.toml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 2951b7010..6b6fd6401 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -32,6 +32,8 @@ ignore = [ # refurb "FURB101", # `open` and `read` should be replaced by `Path(...).read_text(...)` "FURB103", # `open` and `write` should be replaced by `Path(...).write_text(...)` + # perflint + "PERF203", # `try`-`except` within a loop incurs performance overhead # pylint "PLC1901", # simplify truthy/falsey string comparisons # flake8-simplify @@ -159,12 +161,7 @@ select = [ # pandas-vet ('PD') # Pandas is not used in Sphinx # perflint ('PERF') - "PERF101", # Do not cast an iterable to `list` before iterating over it - "PERF102", # When using only the {subset} of a dict use the `{subset}()` method -# "PERF203", # `try`-`except` within a loop incurs performance overhead - "PERF401", # Use a list comprehension to create a transformed list - "PERF402", # Use `list` or `list.copy` to create a copy of a list - "PERF403", # Use a dictionary comprehension instead of a for-loop + "PERF", # pygrep-hooks ('PGH') "PGH", # flake8-pie ('PIE')