-
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 PERF rules, fix E711 and F841 #624
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #624 +/- ##
=======================================
Coverage 91.51% 91.52%
=======================================
Files 620 620
Lines 16478 16469 -9
=======================================
- Hits 15080 15073 -7
+ Misses 1398 1396 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #624 +/- ##
================================================
+ Coverage 95.93000 95.94000 +0.01000
================================================
Files 798 798
Lines 17795 17786 -9
================================================
- Hits 17072 17065 -7
+ Misses 723 721 -2
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 @@ Coverage Diff @@
## main #624 +/- ##
=======================================
Coverage 91.51% 91.52%
=======================================
Files 620 620
Lines 16478 16469 -9
=======================================
- Hits 15080 15073 -7
+ Misses 1398 1396 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -262,9 +262,7 @@ def get_and_modify_owner(self, user_dict, request) -> Owner: | |||
] | |||
|
|||
self._check_enterprise_organizations_membership(user_dict, formatted_orgs) | |||
upserted_orgs = [] |
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.
Perf 1
if coverage_status: | ||
to_be_included = [] |
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.
Perf 2
@@ -56,7 +56,7 @@ def _flatten_selections(self, selection_set: SelectionSetNode) -> Iterable[Node] | |||
if isinstance(selection, FragmentSpreadNode): | |||
fragment = self.info.fragments[selection.name.value] | |||
for selection in fragment.selection_set.selections: | |||
selections.append(selection) |
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.
Skipped Perf
@@ -419,16 +419,16 @@ def compute_report( | |||
branch=self.branch, | |||
) | |||
|
|||
results = [] | |||
for measurable_id in measurable_ids: |
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.
Perf 4
@@ -29,7 +29,7 @@ def file_reports(self): | |||
def flags(self): | |||
"""returns dict(:name=<Flag>)""" | |||
flags_dict = {} | |||
for sid, session in self.sessions.items(): |
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.
Perf 5
Purpose/Motivation
Part of the lint enhancement epic, this PR aims to add the Perflint PERF rules, and fix E711 and F841, which are for Comparison to None should be cond is None and Local variable {name} is assigned to but never used respectively.
These can be found here:
Links to relevant tickets
Closes codecov/engineering-team#1965
What does this PR do?
This PR adds the rules listed above and fixes any errors that stemmed from them.
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.