Skip to content

Consider Utilizing Ruff #62

Description

@cam-barts

As requested in #61, this issue is to track potentially moving to Ruff.

An extremely fast Python linter, written in Rust.

Ruff boasts being a drop in replacement for flake8 as long as certain conditions are met (this project meets those conditions).

On the direction of @priv-kweihmann, I'm happy to generate a PR that does most of the conversion:

  • Run an initial fix on the repo (about 3000 changes, mostly single quotes to double quotes and adding type hints)
  • Update github actions to use ruff or adding ruffs own action
  • Add pre-commit hooks for ruff to help new contributors make good changes
    • pre-commit can be controversial, as some feel it slows down development time. I've found as a code base grows, having a flake8 pre-commit hook can feel sluggish, but switching to ruff I've never found it take even a noticeable amount of time unless of course there are changes to be made. Let me know your thoughts here.
  • Adding a sensible pyproject.toml based configuration for this project
    • setting pydocstyle convention to numpy
    • setting the line length to match blacks (88)
    • adding per file ignores for things like asserts in pytest modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions