Lint library code only with ruff check#1118
Merged
murrayrm merged 23 commits intopython-control:mainfrom Feb 3, 2025
Merged
Conversation
Mostly removing imports; in some cases, placate pyflakes with fake evaluation of not-obviously-used name.
Contributor
Author
|
failure in "Conda-based pytest / Py3.12; conda Slycot; conda Pandas; conda CVXOPT ; QtAgg", in step possibly relevant parts there: |
Member
|
Thanks for putting this together @roryyorke! These changes look good to me. I'll hold on merging in case others want to take a look, but will plan on merging in the next day or two. I'll create an issue to discuss the sporadically failing CI tests. Very annoying to have to re-run them and it seems to be increasing in frequency. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Make library code
ruff checkclean for pyflakes ("F" code) warnings, and checks this in a Github Action."Library code" is all non-test code in
control/, so excludes tests, examples, and benchmarks. Making all of those ruff-check-clean too will take some time, and be a big change, so it seems worth getting this in first. This also gives an opportunity for reviewing the ruff configuration, and the overall approach, e.g., disabling import checks in__init__.py.Besides making the other parts of the code pass lint,
ruffcan do more, and we can look at adding more checks later.Partially addresses gh-1101.
You can see an example of a failing Github Action ruff check here.