-
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: Enable most F rules for Ruff #574
Conversation
@@ -252,7 +253,7 @@ | |||
} | |||
|
|||
# See https://django-postgres-extra.readthedocs.io/en/master/settings.html | |||
POSTGRES_EXTRA_DB_BACKEND_BASE: "django_prometheus.db.backends.postgresql" | |||
POSTGRES_EXTRA_DB_BACKEND_BASE: "django_prometheus.db.backends.postgresql" # type: ignore |
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.
Even post import it didn't resolve this correctly; but docs here: https://django-dbbackup.readthedocs.io/en/stable/databases.html
select = ["F541", "I"] | ||
ignore = [] | ||
select = ["F", "I"] | ||
ignore = ["F841", "F401", "F405", "F403"] |
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.
My preferred way of tackling this initiative; then we can have separate tickets for F841, etc. or multiple PR's
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.
These 4 doesn't have autofixes?
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.
They have some autofixes, but theres like 2k errors I'd have to fix across all of them. So I figured would probably be better to tackle them separately
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #574 +/- ##
==========================================
- Coverage 91.35% 91.35% -0.01%
==========================================
Files 599 599
Lines 15972 15971 -1
==========================================
- Hits 14592 14591 -1
Misses 1380 1380
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found @@ Coverage Diff @@
## main #574 +/- ##
==========================================
- Coverage 91.35% 91.35% -0.01%
==========================================
Files 599 599
Lines 15972 15971 -1
==========================================
- Hits 14592 14591 -1
Misses 1380 1380
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #574 +/- ##
=====================================
Coverage 95.84 95.84
=====================================
Files 777 777
Lines 17290 17289 -1
=====================================
- Hits 16571 16570 -1
Misses 719 719
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Purpose/Motivation
Part of the Ruff Enhancement epic, this adds all the "F" rules to our lint configuration for API, disabling a few super noisy ones that we can fix in individual PR's later. The benefit of doing it this way is we get ~40 rules "for free" that are on now checking our code :) At the cost of letting 4 of them be excluded til we have more bandwidth.
Rule list: https://docs.astral.sh/ruff/rules/#pyflakes-f
Links to relevant tickets
codecov/engineering-team#1716
What does this PR do?
The rules we've mainly had to fix were around duplicate imports or duplicate keys in dicts. The rest we were already good on. Woohoo!
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.