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.
Change Summary
Use
ruff
to improve and maintain coding standards.black
andisort
withruff format
ruff check
pre-commit
configurationAt the moment
ruff check --statistics
reports ~583 improvements:E713
: Test for membership should benot in
F841
: Local variable is assigned to but never usedUP038
: UseX | Y
in call instead of(X, Y)
E722
: Do not use bareexcept
F401
: Module imported but unusedF541
: f-string without any placeholdersUP007
: UseX | Y
for type annotationsE731
: Do not assign alambda
expression, use adef
UP032
: Use f-string instead offormat
callF821
: Undefined nameE711
: Comparison toNone
should beis None
E741
: Ambiguous variable nameE712
: Avoid equality comparisons toTrue
E721
: Do not compare types, useisinstance()
UP031
: Use format specifiers instead of percent formatUP034
: Avoid extraneous parenthesesUP015
: Unnecessary open mode parametersUP035
: Deprecated importF402
: Import shadowed by loop variableF811
: Redefinition of unused module/method/variableUP006
: Usetuple
/list
/dict
instead ofTuple
/List
/Dict
for type annotationUP018
: Unnecessaryfloat
/int
callE714
: Test for object identity should beis not
Related issue number
close #1119
Checklist