Add pre-commit + format all Python code with Ruff#778
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #778 +/- ##
==========================================
- Coverage 88.04% 88.01% -0.04%
==========================================
Files 153 153
Lines 6225 6224 -1
==========================================
- Hits 5481 5478 -3
- Misses 744 746 +2
🚀 New features to boost your workflow:
|
TheStrgamer
approved these changes
Nov 28, 2025
Member
TheStrgamer
left a comment
There was a problem hiding this comment.
Works as intended when i run it.
...so that it can be reused for a linting job. See the GitHub docs on creating a composite action: https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository
Also added a CI linting job to check that all our pre-commit hooks have been run. Also removed the "Global" -> "Empty/blank lines" section in `CONTRIBUTING.md`, as the first, most important part is now enforced by the `end-of-file-fixer` pre-commit hook, and the second part doesn't really bring that much value.
Pretty much all changes in the `.py` files were made by Ruff, but a few of them were made manually by me to made some wrapped lines more readable. Also removed a few now-redundant entries in `CONTRIBUTING.md`.
7ff0306 to
b7fef60
Compare
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.
Proposed changes
pre-commit-hooksandmetahooks (045c536)validate-pyproject(045c536)yamllint(fa52133)ruff-format(b57c22a)Also:
\nnewlines (b7fef60)Review guidance
Highly recommend reviewing one commit at a time! (Also notice the commit message of the Ruff commit, which mentions that pretty much all the changes to the
.pyfiles were made automatically by Ruff.)Also try running
make lintlocally and provide feedback here on how it works for you 🙂Checklist
(If any of the points are not relevant, mark them as checked, so that it's easy to see which points you've handled or not)
makemigrations,makemessagesandcompilemessages