Skip to content

Add ruff for development #251

@nathanjmcdougall

Description

@nathanjmcdougall

As a part of adding type annotations (#243), it might be useful to be aided by a linter that helps identify untyped functions.
An example of this is flake8-annotations but I would like ruff to be considered instead, as a replacement for both flake8 and black.

Besides being faster and a way to prevent tool proliferation, ruff is able to be configured from pyproject.toml (unlike flake8) which would support migration away from setup.cfg to pyproject.toml in the future.

A plan for enabling ruff would be as follows:

PR 1:

  • Migrate black to the latest version in pre-commit config and deal with minor formatting changes (in my testing there would be 8 files with whitespace changes; deleted blank lines).

PR 2:

  • Replacing flake8 and black in the pre-commit config with ruff instead
  • Configuring ruff with equivalent configuration to existing flake8 rules

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions