-
-
Notifications
You must be signed in to change notification settings - Fork 60
Update pre-commit #368
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 pre-commit #368
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Tests are failing with |
This would be easier to review with code fixes in a separate commit. Ruff works much better if rules have been explicitly defined in Adding the rule |
b16789a
to
fd0e508
Compare
I rolled back everything except the actual changes to the pre-commit config. I just copied the pymc ruff configuration, except I removed the global exception for F841, except for tests. If you are happy with where its at, I'll actually run the pre-commit. I switched to using the ruff pyupgrade. The difference is that it forces you to make the changes yourself, whereas pyupgrade does it automatically. I'm lazy so I like pyupgrade, but maybe one less dependency is worth it. |
06790bd
to
1ab4a49
Compare
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.
Nice! This looks great now!
71d1b91
to
0b315a5
Compare
@theorashid can you have a look at this and make sure I didn't miss anything you wanted to see in the configuration? Regarding the points raised in #366 :
For the root directory cleanup questions, you should open a separate issue (and I promise and I won't step on your toes again, sorry) |
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.
The difference is that it forces you to make the changes yourself, whereas pyupgrade does it automatically. I'm lazy so I like pyupgrade, but maybe one less dependency is worth it.
Sorry, GitHub glitched and I didn't see your comment when I previously approved. Give this a whirl and it should fix (almost) everything automatically now.
If you really truly love your reviewer then you can separate your commits even further via git commit --no-verify
to commit the automatic fixes while leaving in the remaining errors so that by-hand fixes can be viewed separately.
0b315a5
to
e6bf0e3
Compare
I do really love my reviewer, so I did as you asked. |
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.
Immaculate!
I'm happy with this. I'll close my PR and let's close the original issue too. Maybe I'll pick up more typos when we clean up the project root |
Closes #350
Switches our pre-commit to use ruff. I also changed the pyupgrade to version 3.10, since that's the minimum we support these days.