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 most "F" Rules on shared #229

Merged
merged 4 commits into from
May 29, 2024
Merged

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented May 28, 2024

This PR aims to add a majority of the F rules to our ruff setup on "shared", including fixing a number of errors stemming from turning those errors on.

Part of the lint enhancement epic here: codecov/engineering-team#1716

Ruff F rules are the Pyflakes rules: https://docs.astral.sh/ruff/rules/#pyflakes-f

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.

@@ -45,3 +45,6 @@ test_env.up:

test_env.test:
docker-compose exec shared python -m pytest --cov=./ --junitxml=junit.xml

test_env.down:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added a make test_env down command since I didn't see one in the file :)

@@ -943,7 +943,7 @@ def get_file_totals(self, path, _else=None):
"""
returns <ReportTotals> for the file if it exists
"""
if self._path_filter and not self._path_filter(filename):
if self._path_filter and not self._path_filter(path):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matt-codecov This one

Copy link
Contributor

Choose a reason for hiding this comment

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

whoops!

@@ -104,7 +104,7 @@ def test_decrypt_token_key_normal_generated_with_secret_pair():
assert res == {"key": value.split(":")[0], "secret": value.split(":")[1]}


def test_decrypt_token_key_normal_generated_with_secret_pair():
def test_decrypt_token_key_normal_generated_with_secret_pair_1():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

duplicate test names for this and below

@@ -23,7 +23,6 @@
{
"f": 203,
"h": 2549,
"m": 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

duplicate keys for this and below

@ajay-sentry ajay-sentry added this pull request to the merge queue May 29, 2024
Merged via the queue into main with commit 2a8964f May 29, 2024
6 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/most-ruff-f-rules-shared branch May 29, 2024 16:53
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.

3 participants