-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update project to use ruff for formatting and linting #81
Conversation
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.
Raising errors with tuples instead of message strings needs fixing, everything else is style or general comments.
8913f01
to
7b173aa
Compare
@TomHall2020 I have been a bit naughty with git magic, but the tuple error messages should be gone now. |
…replace old linting tools with ruff.
…Also includes blackdoc check of docs in workflow.
…causing tests to fail as a result of infinite loop due to next(iter()) inside a try-except.
…s and remove magic number.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
- Coverage 97.86% 97.27% -0.59%
==========================================
Files 28 28
Lines 1499 1505 +6
==========================================
- Hits 1467 1464 -3
- Misses 32 41 +9
|
@TomHall2020 Rebased on top of main after merging your #76 and my #80 if you are now happy with this going in? |
Despite the pain of thinking about rebasing #59 yet again, yeah this looks good, and I definetly won't miss waiting 10 seconds for pylint to run before each commit in the future |
Yeah, sorry, hopefully it isn't too painful... |
Closes #77
Update formatting and linting to use ruff.
This is based on top of handicaps-refactor branch in anticipation of #78 being merged soon.
It took me a while to get my head around ruff and play with it.
I like how configurable it is, but the fact that rules from an existing package (i.e. pylint) may be spread between other rulesets to avoid duplicates makes it tricky to get the same behaviour/how you want it.
I added some rules/rulesets that seemed sensible but didn't trigger anything - it is possible something will trigger in future with code that that feels sensible, so I am open to adding exceptions with good reason.
Notes:
Duplicate code warnings no longer appear, perhaps will in a future update?
ruff does not work on non-python files so needed to add blackdoc for docs.
Source code updated to address issue
Style and formatting applied
Tests written to cover changesDocstrings included/updated in codeProject documentation updated as necessary