Skip to content

Consider switching to ruff #70

@jl-wynen

Description

@jl-wynen

Ruff is similar to flake8 but faster and it has a lot of plugins built in. It does not have full parity with flake8 but in my experience with Scitacean is close enough. It also includes reimplementations of isort and bandit. So switching to it would allow us to handle fewer dependencies (1 instead of 4).

We can then also go through the list of rules and activate additional ones. See e.g. https://github.com/SciCatProject/scitacean/blob/f2c52f5a1bceb3155c4907d76d60c9ada2f58aa8/pyproject.toml#L100-L126 which is working well for be but is rather strict.

There is also an experimental code formatter that tries to be compatible with black as much as possible. An advantage of it would be that it allows us to customise the quotation mark style. I.e., we can make it use single quotes everywhere. So we can normalise the quotes instead of leaving it up to the developer as we do right now. If we want to.

Also, ruff has support for linting and formatting notebooks. I have not tried it though.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions