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
⬆️ Upgrade configuration for Ruff v0.2.0 #11075
Conversation
In this PR, I'd also recommend:
fastapi/requirements-tests.txt Line 7 in 50e558e
fastapi/.pre-commit-config.yaml Lines 16 to 17 in 50e558e
|
Will do! v0.2.0 wasn't out yet when I put this up -- I'll update the PR to do the version bump too. |
b33734d
to
32931b7
Compare
@@ -21,6 +21,6 @@ def query_or_cookie_extractor( | |||
|
|||
@app.get("/items/") | |||
async def read_query( | |||
query_or_default: Annotated[str, Depends(query_or_cookie_extractor)] | |||
query_or_default: Annotated[str, Depends(query_or_cookie_extractor)], |
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.
This is a change that was also made in latest Black: psf/black#4164.
📝 Docs preview for commit 312978b at: https://d38c0b0b.fastapitiangolo.pages.dev |
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.
Ruff v0.2.2 is out.
@@ -14,7 +14,7 @@ repos: | |||
- id: end-of-file-fixer | |||
- id: trailing-whitespace | |||
- repo: https://github.com/charliermarsh/ruff-pre-commit | |||
rev: v0.1.2 | |||
rev: v0.2.0 |
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.
v0.2.2 is out!
rev: v0.2.0 | |
rev: v0.2.2 |
@@ -4,7 +4,7 @@ pydantic-settings >=2.0.0 | |||
pytest >=7.1.3,<8.0.0 | |||
coverage[toml] >= 6.5.0,< 8.0 | |||
mypy ==1.4.1 | |||
ruff ==0.1.2 | |||
ruff ==0.2.0 |
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.
ruff ==0.2.0 | |
ruff ==0.2.2 |
Awesome, thank you @charliermarsh! 🚀 |
In Ruff v0.2.0 (upcoming), we start to warn about adding these settings under
[tool.ruff]
instead of[tool.ruff.lint]
. This PR just adjusts FastAPI's configuration to fix those warnings. (This works today, with the version of FastAPI uses now, and will also work with v0.2.0.)