Skip to content
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 E, PLC, and PLE ruff rules #505

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented Jun 17, 2024

Purpose/Motivation

Part of the lint enhancement epic, this PR aims to add the Pycodestyle error rules, and the Pylint Convention and Pylint Error rules.
These can be found here:

A majority of the fixes were related to E721 (isinstance comparisons), E722 (bare except), E713 (test for membership should be not in), and E711 (Comparison to None should be cond is None)

NOTE: I added ignores to all the SQL Alchemy code because it BREAKS when using is None vs. == None. This is because of how the "SQL" is parsed with == vs. the Python specific "is."

Links to relevant tickets

Closes codecov/engineering-team#1930

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.

@@ -16,7 +16,7 @@
| 1|line
1k| 2|line
warning: The file '/Users/Jack/Documents/Coupgon/sdk-ios/Source/CPGCoupgonsViewController.swift' isn't covered.
\033/file:\033[0m
\033\x1b[0;36m/file:\033[0m
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the following two files were some broken escape characters

@codecov-notifications
Copy link

codecov-notifications bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
- Coverage   97.45%   97.45%   -0.01%     
==========================================
  Files         416      416              
  Lines       34759    34764       +5     
==========================================
+ Hits        33876    33880       +4     
- Misses        883      884       +1     
Flag Coverage Δ
integration 97.45% <92.98%> (-0.01%) ⬇️
latest-uploader-overall 97.45% <92.98%> (-0.01%) ⬇️
unit 97.45% <92.98%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.45% <84.61%> (-0.01%) ⬇️
OutsideTasks 97.72% <96.96%> (-0.01%) ⬇️
Files Coverage Δ
database/models/core.py 97.10% <ø> (ø)
database/tests/unit/test_model_utils.py 100.00% <100.00%> (ø)
helpers/checkpoint_logger/__init__.py 94.62% <100.00%> (+0.02%) ⬆️
helpers/tests/pathmap/test_tree.py 100.00% <100.00%> (ø)
services/commit_status.py 100.00% <100.00%> (ø)
services/github.py 95.00% <100.00%> (+0.12%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
...s/notification/notifiers/mixins/message/helpers.py 92.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_status.py 100.00% <ø> (ø)
... and 28 more

@codecov-qa
Copy link

codecov-qa bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.

Project coverage is 97.45%. Comparing base (4840ca4) to head (157e946).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
- Coverage   97.45%   97.45%   -0.01%     
==========================================
  Files         416      416              
  Lines       34759    34764       +5     
==========================================
+ Hits        33876    33880       +4     
- Misses        883      884       +1     
Flag Coverage Δ
integration 97.45% <92.98%> (-0.01%) ⬇️
latest-uploader-overall 97.45% <92.98%> (-0.01%) ⬇️
unit 97.45% <92.98%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.45% <84.61%> (-0.01%) ⬇️
OutsideTasks 97.72% <96.96%> (-0.01%) ⬇️
Files Coverage Δ
database/models/core.py 97.10% <ø> (ø)
database/tests/unit/test_model_utils.py 100.00% <100.00%> (ø)
helpers/checkpoint_logger/__init__.py 94.62% <100.00%> (+0.02%) ⬆️
helpers/tests/pathmap/test_tree.py 100.00% <100.00%> (ø)
services/commit_status.py 100.00% <100.00%> (ø)
services/github.py 95.00% <100.00%> (+0.12%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
...s/notification/notifiers/mixins/message/helpers.py 92.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_status.py 100.00% <ø> (ø)
... and 28 more

Copy link

codecov-public-qa bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 97.45%. Comparing base (4840ca4) to head (157e946).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
- Coverage   97.45%   97.45%   -0.01%     
==========================================
  Files         416      416              
  Lines       34759    34764       +5     
==========================================
+ Hits        33876    33880       +4     
- Misses        883      884       +1     
Flag Coverage Δ
integration 97.45% <92.98%> (-0.01%) ⬇️
latest-uploader-overall 97.45% <92.98%> (-0.01%) ⬇️
unit 97.45% <92.98%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.45% <84.61%> (-0.01%) ⬇️
OutsideTasks 97.72% <96.96%> (-0.01%) ⬇️
Files Coverage Δ
database/models/core.py 97.10% <ø> (ø)
database/tests/unit/test_model_utils.py 100.00% <100.00%> (ø)
helpers/checkpoint_logger/__init__.py 94.62% <100.00%> (+0.02%) ⬆️
helpers/tests/pathmap/test_tree.py 100.00% <100.00%> (ø)
services/commit_status.py 100.00% <100.00%> (ø)
services/github.py 95.00% <100.00%> (+0.12%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
...s/notification/notifiers/mixins/message/helpers.py 92.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_status.py 100.00% <ø> (ø)
... and 28 more

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.

Project coverage is 97.48%. Comparing base (4840ca4) to head (157e946).
Report is 1 commits behind head on main.

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

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
- Coverage   97.48%   97.48%   -0.01%     
==========================================
  Files         447      447              
  Lines       35488    35493       +5     
==========================================
+ Hits        34595    34599       +4     
- Misses        893      894       +1     
Flag Coverage Δ
integration 97.45% <92.98%> (-0.01%) ⬇️
latest-uploader-overall 97.45% <92.98%> (-0.01%) ⬇️
unit 97.45% <92.98%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.50% <84.61%> (-0.01%) ⬇️
OutsideTasks 97.72% <96.96%> (-0.01%) ⬇️
Files Coverage Δ
database/models/core.py 97.10% <ø> (ø)
database/tests/unit/test_model_utils.py 100.00% <100.00%> (ø)
helpers/checkpoint_logger/__init__.py Critical 94.68% <100.00%> (+0.02%) ⬆️
helpers/tests/pathmap/test_tree.py 100.00% <100.00%> (ø)
services/commit_status.py 100.00% <100.00%> (ø)
services/github.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
...s/notification/notifiers/mixins/message/helpers.py 92.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <100.00%> (ø)
...s/notification/notifiers/tests/unit/test_status.py 100.00% <ø> (ø)
... and 28 more
Related Entrypoints
run/app.tasks.upload.Upload
run/app.tasks.notify.Notify
run/app.tasks.upload.UploadFinisher
run/app.tasks.upload.UploadProcessor

@ajay-sentry ajay-sentry added this pull request to the merge queue Jun 20, 2024
Merged via the queue into main with commit 099e190 Jun 20, 2024
19 of 29 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/most-e-ruff-rules-with-plc-ple branch June 20, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add E, PLE, PLC Rules to Worker
2 participants