[#310] Run Ruff check and format on codebase #311
Draft
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.
Addresses #310
Test suite passed.
Please have a look at the config file and see whether there are any tweaks we want to make. The one shown is the default, but we can modify it and point the workflows at it.
Some thoughts:
I didn't do very much work to apply these fixes. Ruff did most of it itself. The GitHub Actions workflow uses
--diff, so it will not modify anything in PRs. I might update the README to include a tidbit about running Ruff locally because that was incredibly easy as well. I just ran the docker container as described here: https://docs.astral.sh/ruff/installationHere's what running the check (linter) looks like:
I included
--unsafe-fixesas well to try to fix everything and then combed through the changes and fixed what didn't quite work out the way it should have. You can of course just use--diffto only display a diff like in GitHub Actions.And here's what running the formatter looks like:
I consider this a forerunner to using Ruff in the python-irodsclient (https://github.com/irods/python-irodsclient) repo. We can try it out here to see if we like it, and, if so, we can apply it there as well.