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

Replace isort, black, pylint with ruff #246

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Replace isort, black, pylint with ruff #246

merged 3 commits into from
Nov 5, 2024

Conversation

theferrit32
Copy link
Contributor

@theferrit32 theferrit32 commented Nov 5, 2024

Closes #123

@theferrit32 theferrit32 self-assigned this Nov 5, 2024
@theferrit32 theferrit32 marked this pull request as ready for review November 5, 2024 17:22
@theferrit32
Copy link
Contributor Author

Closes #123

@bpblanken
Copy link
Contributor

Here's what I got working in seqr if you're interested: https://github.com/broadinstitute/seqr-loading-pipelines/blob/main/pyproject.toml#L33-L54

@theferrit32
Copy link
Contributor Author

@bpblanken cool I was looking through the other rule sets. Some of the style ones will be annoying to fix.

@theferrit32
Copy link
Contributor Author

Wild suggestion here

clinvar_ingest/api/main.py:7:26: TCH002 Move third-party import `google.cloud.bigquery` into a type-checking block
  |
6 | from fastapi import BackgroundTasks, FastAPI, HTTPException, Request, status
7 | from google.cloud import bigquery
  |                          ^^^^^^^^ TCH002
8 |
9 | import clinvar_ingest.config
  |
  = help: Move into type-checking block

It wants to change it to this:

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from google.cloud import bigquery

Copy link
Contributor

@toneillbroad toneillbroad left a comment

Choose a reason for hiding this comment

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

Nice work

@bpblanken
Copy link
Contributor

bpblanken commented Nov 5, 2024

@theferrit32 the TYPE_CHECKING thing is normal though it looks crazy. It's designed to help with circular imports for type annotations.

If you look hard, the only place bigquery is used is a type.

@theferrit32 theferrit32 merged commit e81ccf6 into main Nov 5, 2024
2 checks passed
@theferrit32 theferrit32 deleted the issue-123-ruff branch November 5, 2024 21:40
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.

Enable more Ruff rules
3 participants