-
Notifications
You must be signed in to change notification settings - Fork 438
Lint library code only with ruff check
#1118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Mostly removing imports; in some cases, placate pyflakes with fake evaluation of not-obviously-used name.
failure in "Conda-based pytest / Py3.12; conda Slycot; conda Pandas; conda CVXOPT ; QtAgg", in step possibly relevant parts there:
|
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. |
Make library code
ruff check
clean 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,
ruff
can 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.