-
Notifications
You must be signed in to change notification settings - Fork 1
Change Python code formatting and linting tools #270
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
base: main
Are you sure you want to change the base?
Conversation
vivus-ignis
left a comment
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.
While I'm two hands for getting rid of pyright, this PR doesn't seem to be in line with the title and concerns many other topics too. Could you split it into smaller focused parts?
Thanks for your feedback. As mentioned in the description this PR requires #248. With that being merged the changes are only focused on typing changes and |
You mean this PR contains changes that are going to be merged in another PR? |
That's correct. As both PRs #248 and this one change the same files it's not possible to separate them in a useful way. |
Signed-off-by: Tobias Wolf <[email protected]> On-behalf-of: SAP <[email protected]>
Signed-off-by: Tobias Wolf <[email protected]> On-behalf-of: SAP <[email protected]>
Signed-off-by: Tobias Wolf <[email protected]> On-behalf-of: SAP <[email protected]>
Signed-off-by: Tobias Wolf <[email protected]> On-behalf-of: SAP <[email protected]>
a8f18a1 to
86e9193
Compare
vivus-ignis
left a comment
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.
Ship it
86e9193 to
efd4075
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
==========================================
+ Coverage 90.63% 91.40% +0.77%
==========================================
Files 42 42
Lines 2008 2037 +29
==========================================
+ Hits 1820 1862 +42
+ Misses 188 175 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
efd4075 to
ba27878
Compare
Signed-off-by: Tobias Wolf <[email protected]> On-behalf-of: SAP <[email protected]>
ba27878 to
212b2d6
Compare
|
Just checking in because I got the notification. Can you clear up for me what benefit this setup will have over the |
For Code formatting in That being said I find the code now formatted and verified with the tools used way more readable in some corner cases (asserts, prefering inline functions instead `lambda etc.). |
yeoldegrove
left a comment
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.
@NotTheEvilOne I am fine with the changes but as @ByteOtter pointed out, the PR title and description is missing important context.
Could you please simply sum at what you commented and update the description? What is removed, what is added and why?
pyright with pre-commit
Done |
|
Thanks for updating the descriptions this makes it more clear why this is happening. I already laid out my position, but in the end if it's a popular decision go ahead. However, I would like to point out that we should then also switch @yeoldegrove's tooling for gardenlinux' test-ng as well so we stay consistent. (Add the benefit of not having to maintain separate IDE configs for two places) |
Good point! |
What this PR does / why we need it:
This PR switches the Python code linting tool from
pyrighttomypybased onpre-commit. It additionally replacesblackwithruffagain based onpre-commit. Based on these tools changes to the underlying Python code has been integrated.The switch from
pyrightis based on the author's opinion that the linting tool produces way more false-positives thanmypywhich is more configurable regarding typing of third-party Python packages as well. This issue made it more difficult to meet expected code changes expected bypyrightand therefore a higher burden to provide changes to the code base.Code formatting in
ruffon the other hand feels more Pythonic than whatblackis enforcing in the configuration we used.Which issue(s) this PR fixes:
Related #165
Requires #248