ImagingDataCommons / highdicom

High-level DICOM abstractions for the Python programming language
https://highdicom.readthedocs.io
MIT License
162 stars 34 forks source link

Enforce ruff/flake8-pyi rules (PYI) #292

Closed DimitriPapadopoulos closed 3 weeks ago

DimitriPapadopoulos commented 3 weeks ago

I used ruff --extend--select PYI for this specific merge request. Ideally I should have used ruff --config 'line-length = 80' --extend--select PYI instead of fixing possible line length issues after linting. Since you're using flake8, you just need to add to your test requirements the relevant plugin — in this case flake8-pyi.

DimitriPapadopoulos commented 3 weeks ago

More generally, for ruff rules that implement the rules of flake8 plugins, just install the plugin:

For ruff rules that implement the rules of other tools, add the relevant tool to your test dependencies and add them to the CI jobs:

For ruff rules, you have no other choice than adding ruff to your setup:

DimitriPapadopoulos commented 3 weeks ago

If you do want to enforce many of these rules, I would recommend moving to ruff altogether.