Enable ruff F821 F822 F823 #1014
Merged
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.
This PR adds rules F821-823:
__all__should exist. Critical, but also seems a bit too evident, might not be worth it to have it as a rule? Fine with removing it.I think adding these rules makes sense and does not significantly raise the bar for contributions, while still being good for preventing bugs, which is the philosophy agreed upon in #539. In recent months, a few bugs in main were already identified manually and fixed, which would have been caught by these rules too, e.g. part of the small fixes in #981 , #955, so these rules do correspond with real bugs which occur during development, not some hypothetical scenarios (note also the change in
optim_iteratorfixes a live bug (albeit small).Checks to be done before submitting your PR
python3 -m pytest deepinv/testsruns successfully.black .runs successfully.make htmlruns successfully (in thedocs/directory).