[#310] Run Ruff check and format on codebase#311
Draft
alanking wants to merge 3 commits into
Draft
Conversation
The Ruff TOML configuration file reflects the default Ruff configuration. We can adjust this according to our preferences.
Includes --unsafe-fixes as well as manual intervention.
Collaborator
Author
|
You can see the GitHub Actions workflow results over in a test PR I made in my fork: alanking#1 Not sure why they won't run here - guess it's different because it's not my repo. EDIT: And here's what it looks like if the problems aren't gone: alanking#2 |
Collaborator
Author
|
Converting to draft until irods/python-irodsclient#726 is a bit further along. We will want to do something similar if not identical in this repo. |
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.
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.