Skip to content

Ruff PERF401: list-comprehension findings in core engine files #489

Closed

Description

@squid-protocol

Objective

Part of the ruff lint baseline cleanup (PERF401 -- a for loop that just .append()s could be a list comprehension). Chunked out of the larger sub-issue this replaces, so it's a manageable, self-contained pickup.

Findings

  • gitgalaxy/core/detector.py:817 (PERF401) -- Use list.extend to create a transformed list
  • gitgalaxy/core/detector.py:974 (PERF401) -- Use list.extend to create a transformed list
  • gitgalaxy/core/network_risk_sensor.py:282 (PERF401) -- Use a list comprehension to create a transformed list
  • gitgalaxy/core/prism.py:452 (PERF401) -- Use list.extend to create a transformed list
  • gitgalaxy/metrics/signal_processor.py:2459 (PERF401) -- Use list.extend to create a transformed list
  • gitgalaxy/metrics/statistical_auditor.py:240 (PERF401) -- Use list.extend to create a transformed list

Fix in a small PR, removing resolved entries from tests/ruff_audit_baseline.json (see tests/ruff_audit.py's module docstring for the regen command).

Parent: #469

Activity

  1. added
    good first issue
    python
    refactor
    priority: low
    on Jul 26, 2026
  2. squid-protocol commented on Aug 9, 2026

    @squid-protocol
    OwnerAuthor

    FYI while doing a pass to check for staleness across the "good first issue" label: 1 of the 6 findings listed here has already been fixed incidentally (no longer flagged by ruff check, no longer in the baseline) -- looks like a side effect of unrelated edits to this file, not a targeted fix:

    • gitgalaxy/core/prism.py (was :452) PERF401

    The other 5 findings are still live, confirmed against a fresh ruff check (pinned 0.16.0) + the current baseline. Whoever picks this up can drop that one line item from the findings list.

  3. added a commit that references this issue on Aug 10, 2026
    7566d91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuepriority: lowpythonrefactor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions