-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Add ruff rules for TYPE_CHECKING (TCH) #3999
Conversation
763be9b
to
7b6d66c
Compare
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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.
Wow, I didn't know this existed. This is nice.
LGTM
Putting this on hold as FastAPI annotations need runtime evaluation and I couldn't make |
77e1675
to
6db6f52
Compare
6db6f52
to
2a16f39
Compare
2a16f39
to
bc9c1f0
Compare
@@ -198,6 +204,11 @@ ignore = [ | |||
"ISC001", # Messes with the formatter | |||
] | |||
|
|||
[tool.ruff.lint.per-file-ignores] | |||
"langflow/api/v1/*" = [ | |||
"TCH", # FastAPI needs to evaluate types at runtime |
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.
I had to ignore here. Ideally we would use flake8-type-checking.runtime-evaluated-decorators
but I couldn't make it work with fastapi's APIRouter annotations without importing the router from a separate file. This looks like a bug in ruff.
No description provided.