Skip to content

Consider replacing various linters/formatters with pre-commit and ruff #859

@bpkroth

Description

@bpkroth

We have a decent collection of linters/formatters at this point to ensure good code quality.
However, they can take a while to run (pylint in particular) and a selling point for ruff is

⚡️ 10-100x faster than existing linters (like Flake8) and formatters (like Black)

We've worked around that somewhat by using make file rules that can execute in parallel, however that complicates the dev environment and dependencies a tad (which we again workaround using devcontainers).

Another option could be to use something like pre-commit and ruff.

A quick look seems to indicate it would flag a bunch of things off the bat, so we'd have to create a bunch of exceptions and/or cleanup some things at the same time.

We'd also probably want to remove a pile of our exceptions from the code.

And enable the VScode extension.

Anyways, not sure it's worth it, but here's a branch that quickly started that effort:

https://github.com/bpkroth/MLOS/tree/ruff

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions