Skip to content

[Feature]: Use Ruff for Linting and Formatting #290

@cagyirey

Description

@cagyirey

Is your feature request related to a problem?

Currently, the linting+formatting system uses black, isort and flake8 in CI/CD and pre-commit but these are quite honestly a bit outdated, slow, and requires three dependencies with their own configurations instead of one. ruff>=0.4 is installed but not used, which suggests a migration might have been intended at some point.

medium.com/@benedictxneo has a good blog with an overview of the tool, its speed and links to more resources on it.

Describe the Solution you'd like

  • Review these linting rules and merge or request changes
  • Review the linting changes in this diff
  • Run pre-commit run --all-files (safe fixes+formatting) and uv ruff check . --fix --unsafe-fixes from chore(linting): replace black, isort and flake8 with ruff #281 to apply the linting changes.
  • CI runs to confirm --unsafe-fixes are actually safe to apply (I've tested them on my Mac and CUDA desktop with Qwen models so far; confidence >95%)
  • Merge the PR to upgrade ruff to 0.14.x, apply new linting rules and remove the old linting stack.

Alternatives Considered (Optional)

Not really. ruff was designed as a modern alternative for specifically this use case (replacing slow, sprawling Python linting standards).

Additional Context (Optional)

Because ruff is already installed, I figured it would be best to do a purely cosmetic change before anything that adds/removes packages or impacts the build system. What I'd like to do next is migrate from the mixed usage of pip and Poetry for the build system to uv and hatchling for consistency/correctness, speed, supply chain security‼️, expand the testing matrix from Python 3.11 to include everything up until 3.14.

Parallax does work on 3.14 and pytest passes on all versions, by the way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions