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

⬆️ Upgrade configuration for Ruff v0.2.0 #11075

Merged
merged 3 commits into from Mar 26, 2024

Conversation

charliermarsh
Copy link
Contributor

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.)

@alejsdev alejsdev changed the title Upgrade configuration for Ruff v0.2.0 ⬆️ Upgrade configuration for Ruff v0.2.0 Feb 2, 2024
@chrimaho
Copy link

chrimaho commented Feb 4, 2024

In this PR, I'd also recommend:

  1. Adjust the requirements-tests.txt file to: ruff >=0.1.2

ruff ==0.1.2

  1. Adjust the .pre-commit-config.yaml file to: rev: v0.2.0

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.2

@charliermarsh
Copy link
Contributor Author

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.

@@ -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)],
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 is a change that was also made in latest Black: psf/black#4164.

@tiangolo
Copy link
Owner

tiangolo commented Feb 7, 2024

📝 Docs preview for commit 312978b at: https://d38c0b0b.fastapitiangolo.pages.dev

Copy link

@siavashyj siavashyj left a 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

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!

Suggested change
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

Choose a reason for hiding this comment

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

Suggested change
ruff ==0.2.0
ruff ==0.2.2

@tiangolo tiangolo merged commit 5ccc869 into tiangolo:master Mar 26, 2024
42 checks passed
@tiangolo
Copy link
Owner

Awesome, thank you @charliermarsh! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants