-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Ruff linter #7091
Ruff linter #7091
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7091 +/- ##
==========================================
+ Coverage 92.21% 92.23% +0.02%
==========================================
Files 101 101
Lines 16912 16884 -28
==========================================
- Hits 15595 15573 -22
+ Misses 1317 1311 -6
|
Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
@ricardoV94 Here are some additional improvements after your first review:
The pre-commit job goes from 55s -> 23s (on average) after the |
@ricardoV94 I had forgotten to include |
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.
This is pretty exciting. We should be able to get rid of pyupgrade
too.
|
||
[tool.black] | ||
[tool.ruff] | ||
line-length = 100 | ||
|
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.
This should be "py39"
, but I don't think we want to tackle that in this PR.
target-version = "py37" | |
Co-authored-by: Ben Mares <services-git-throwaway1@tensorial.com>
Co-authored-by: Ben Mares <services-git-throwaway1@tensorial.com>
Similarly for |
The default rules in It can be disappointing to have a previously-passing check that doesn't run, and then by the time you discover and fix it, it requires changing substantial parts of the codebase. (I've seen that happen with a malfunctioning line-length check, and then it's a battle to get that under control again.) |
When I add |
Of course, just add an ignore for The point is that there's lots of other things you'll pick up for free or almost for free. |
@maresb Thanks for the feedback! I think addressed all your comments. Please let me know if I missed something 🙏 |
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.
Looks excellent, great work!!!
Thanks a ton guys! |
Thanks for your help! Please report any issue and I will try to solve it 💪 |
@juanitorduz I hear you are doing PyTensor next :D? |
There is a PR open so I would not want to interfere 😅. I'll he happy to support though ! |
I think that one is stale, should be fine to take over (you can ask) |
Closes #7084
I tried adding minimal changes to keep up the default ruff configuration (see https://github.com/astral-sh/ruff?tab=readme-ov-file#configuration). Please review carefully 🤓 !
Type of change
📚 Documentation preview 📚: https://pymc--7091.org.readthedocs.build/en/7091/