Skip to content

Ruff UP045: Optional[X] -> X | None in config_resolver.py #503

Description

@squid-protocol

Objective

Part of the ruff lint baseline cleanup (UP045 -- Optional[X] could be X | None (PEP 604)). Chunked out of the larger sub-issue this replaces, so it's a manageable, self-contained pickup.

Findings

  • gitgalaxy/standards/config_resolver.py:250 (UP045) -- Use X | None for type annotations
  • gitgalaxy/standards/config_resolver.py:251 (UP045) -- Use X | None for type annotations
  • gitgalaxy/standards/config_resolver.py:252 (UP045) -- Use X | None for type annotations

Approach

PEP 604 syntax requires no further Python-version gymnastics since this project's floor is 3.9 and from __future__ import annotations handles runtime evaluation where needed -- confirm that per call site before batch-converting.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueAccessible entry point for new community contributorspriority: lowUI tweaks, documentation, and minor optimizationspythonPython-specific runtime or environment optimizationsrefactorStructural cleanup or optimization without altering behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions