Current ruff linter configuration applies a certain set of rules. However more rules were already selected to be introduced at some point. These currently live in the ignore section and should be moved up to the select section.
The first introduction of these rules comes with some manual work to first get the codebase to the rules' standards.
A good way to add a rule is to introduce it step by step, e.g.:
- Run
ruff check only against sdk/basyx
- If possible, apply fixes with
ruff check --fix (or even unsafe-fixes)
- Run tests (
mypy tends to surface errors) to see if fixes are breaking
- Only then expand to tests, repeat for other modules
Checklist (also see ruff.toml) of open rules:
PYI currently requires an additional dependency; after the introduction of a newer python version this can easily be introduced (see #594)
Might need more work to add:
Should be evaluated if we even want to add them:
Current ruff linter configuration applies a certain set of rules. However more rules were already selected to be introduced at some point. These currently live in the
ignoresection and should be moved up to theselectsection.The first introduction of these rules comes with some manual work to first get the codebase to the rules' standards.
A good way to add a rule is to introduce it step by step, e.g.:
ruff checkonly againstsdk/basyxruff check --fix(or even unsafe-fixes)mypytends to surface errors) to see if fixes are breakingChecklist (also see
ruff.toml) of open rules:PYIcurrently requires an additional dependency; after the introduction of a newer python version this can easily be introduced (see #594)"PYI", # typing best practicesMight need more work to add:
"F403", # star imports - high existing usage"F405", # may-be-undefined from star imports"N818", # Exception name should be named with Error suffix"N", # pep8-naming"B", # flake8-bugbear"T20", # prevent native print() statements"A", # prevent shadowing of python builtins"FIX", # prevent the creation of T0DO / F1XME commentsShould be evaluated if we even want to add them:
"S", # security related precautions"BLE", # prevent unspecified excepts