-
Notifications
You must be signed in to change notification settings - Fork 28
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
dev: Add Ruff to API, enable F541 as first rule #555
Conversation
Codecov ReportAttention: Patch coverage is
Changes have been made to critical files, which contain lines commonly executed in production. Learn more ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #555 +/- ##
=======================================
+ Coverage 95.81 95.82 +0.01
=======================================
Files 777 777
Lines 17267 17265 -2
=======================================
- Hits 16544 16543 -1
+ Misses 723 722 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
echo "Installing..." | ||
pip install -Iv black==22.3.0 isort | ||
pip install -Iv ruff | ||
|
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.
Is this file the only non auto generated change in the PR?
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.
and the ruff.toml which has some slight tweaks from the default here: https://docs.astral.sh/ruff/configuration/
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.
Are the rules same as the the worker repo?
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.
worker
is more or less using the default except for the extra linting of F401
. It's good that you added the ruff.toml
file!
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.
lgtm
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #555 +/- ##
==========================================
- Coverage 91.32% 91.32% -0.01%
==========================================
Files 599 599
Lines 15948 15947 -1
==========================================
- Hits 14565 14564 -1
Misses 1383 1383
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found @@ Coverage Diff @@
## main #555 +/- ##
==========================================
- Coverage 91.32% 91.32% -0.01%
==========================================
Files 599 599
Lines 15948 15947 -1
==========================================
- Hits 14565 14564 -1
Misses 1383 1383
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
🚀
Purpose/Motivation
Part of https://www.notion.so/sentry/Migrating-to-Ruff-bf528650b6d14fad8cb9964da7cafcbe proposal, we are moving over to using Ruff for linting and formatting, deprecating isort and black in the process.
This PR simply plugs in ruff into our make lint command and enables a single rule https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/
Links to relevant tickets
closes codecov/engineering-team#1719
What does this PR do?
Adds ruff.toml, which is basically our ruff configuration file that is checked against when running the make command. This will allow us to easily update configuration in the future without having to muddy the make command as we add more rules.
Updates the make lint, make install, and make run commands to be Ruff specific, deprecating use of isort and black.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.