-
Notifications
You must be signed in to change notification settings - Fork 21
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
Use ruff to format and lint #114
Conversation
I'm not sure why the coverage report is way down, but I've remember seeing sudden changes in coverage reports before (e.g. flopy). I don't think the coverage is super meaningful at the moment, though, since most of the tests don't check the answers. It's still nice to know there's no syntax errors though -- although I think ruff should catch that now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, approving in advance. I had a few comments that might or might not be relevant.
One more thought, we could consider adding isort and formatting checks using ruff, instead of only checking linting? |
Running ruff check takes care of this. If I scramble the imports:
Ruff will complain appropriately:
It's part of the current configuration:
|
Sorry, i forgot import sorting is checked by |
You're right, turns out I was a little confused... isort is part of the linting, but the formatting isn't. To check for the formatting, we need to run |
Well, I just got confirmation from the CI that it does check:
Turns out I had the ignore examples bit still in locally... |
Well that was dumb... completely forgot this PR was already open, and went and created my own... I'm gonna merge the two and then pull that into dev. |
* Ruff formatting + checks - add ruff ruff settings to pyproject.toml - use ruff gh actions - add python 3.12, remove python 3.8 - fix most ruff issues in code base (see pyproject.toml for ignore list). * Use ruff to format and lint (#114) * Use ruff to format and lint, fix all issues that came up. * Git blame: ignore ruff style changes * Looks like ruff trivialized test_import * Do not exclude examples from ruff * Remove unused computation in StripAreaSink.changetrace * Add ruff format --check in linting step * Also format the examples * Add examples ruff format to git-blame-ignore * more ruff after merge * this file shouldnt be in this PR. * speed up building docs using autoapi * formatting * more formatting --------- Co-authored-by: Huite <[email protected]>
In a nutshell:
ruff check .
now. Not sure if this replicates the current behavior (or how far that is possible with ruff).There's some funny stuff here and there, which is touched by ruff, but not everything is fixed.
For example, this bit in stripareasink
changetrange
:None of these are used...?
ruff has removed the assignment, but I think the lines could be deleted outright.