chore: bump ruff version from 0.3.3 to 0.9.2 and fix some invalid/dead noqas #3282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that the ruff version was a bit outdated, and that there where quite a lot of spurious/dead
# noqa
lingering around.This PR bumps ruff to the latest version, which has lead to a minor re-formatting of some code (mainly around fusing string literals).
I've also enabled a few ruff rules that have helped me to identify dead or malformed (
# noqa <code>
instead of the needed# noqa: <code>
patter) noqa rules.Regarding
F401
: Here we should stick to the library interface conventions from the official specs. Otherwise type checkers will not understand the symbols exported in these modules, which is a frequent paint point on user side, when libraries suppressF401
. There are basically two options:__all__
list manually.X as X
pattern to mark these symbols as explicitly public (and to differentiate them from actual unused imports).I felt that the latter fits better to how Aim maintains its library interface.
My plan is to fully fix all
F401
in a follow-up, because the broken library interface is biting us.