-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruff: incremental adoption #5625
Comments
See #5612 |
Now #5636 is merged there is now a list of rules that are in the ignore section explicitly can now be addressed one by one in separate PR's. Rules look here here https://docs.astral.sh/ruff/rules/#pydocstyle-d
|
This was referenced Dec 17, 2023
Merged
Merged
This was referenced Dec 19, 2023
This was referenced Dec 30, 2023
This was referenced Jan 8, 2024
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
📰 Custom Issue
As #5623 has been merged, we're now in the position where we can slowly adopt incremental compliance of the ruff linter rules.
Our
ruff
configuration is defined in two files:pyproject.toml
: this contains the mainruff
configuration for the linter (and formatter, when adopted) and permanent rule exclusions.ruff.toml
: this configuration extends thepyproject.toml
and contains temporary rule exclusionsThe goal of our
ruff
adoption is two-fold:.ruff.toml
on a piecemeal basis e.g.,"F"
or"ANN"
etcruff
.Tackling Rules
We need to agree on a general way forward here.
However, essentially it will involve the following steps:
.ruff.toml
.ruff
in your development environment e.g.,pip install ruff
.ruff
e.g.,ruff .
ruff --fix .
to auto-fix..ruff.toml
, as we are now compliant."F"
(Pyflakes), which represents allpyflakes
rules, with exact"Fxxx"
rule instances that still require to be ignored.Note that, rules can be ignored across all of
iris
by using the[tool.ruff.lint.ignore]
in thepyproject.toml
or thelint.ignore
in the.ruff.toml
.Rules can also be ignored on a per file basis:
pyproject.toml
..ruff.toml
.As a result of tackling the temporary rule exceptions in
.ruff.toml
we may uncover permanent rule exceptions that we want to adopt. These should be discussed, and if agreed, added and documented in thepyproject.toml
.Drop Third-Party Packages
The
ruff
linter and formatter replace the following packages, which we can now drop:black
(Replace black with ruff #5634)ruff
formattertool.black
section frompyproject.toml
pre-commit
hook from.pre-commit-config.yaml
README.md
isort
(Replace isort with ruff #5633)tool.isort
section frompyproject.toml
pre-commit
hook from.pre-commit-config.yaml
"I"
rule ignore from.ruff.toml
flake8
.flake8
configuration fileMANIFEST.in
pre-commit
hook from.pre-commit-config.yaml
The text was updated successfully, but these errors were encountered: