⬆️ Upgrade Ruff version and configs (#859)

This commit is contained in:
Sebastián Ramírez 2024-03-26 12:35:15 -05:00 committed by GitHub
parent 9d0b8b6a93
commit bf51a11dcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6 rev: v0.2.0
hooks: hooks:
- id: ruff - id: ruff
args: args:

View File

@ -47,7 +47,7 @@ cairosvg = "^2.5.2"
mdx-include = "^1.4.1" mdx-include = "^1.4.1"
coverage = {extras = ["toml"], version = ">=6.2,<8.0"} coverage = {extras = ["toml"], version = ">=6.2,<8.0"}
fastapi = "^0.103.2" fastapi = "^0.103.2"
ruff = "^0.1.2" ruff = "0.2.0"
# For FastAPI tests # For FastAPI tests
httpx = "0.24.1" httpx = "0.24.1"
# TODO: upgrade when deprecating Python 3.7 # TODO: upgrade when deprecating Python 3.7
@ -92,14 +92,14 @@ disallow_incomplete_defs = false
disallow_untyped_defs = false disallow_untyped_defs = false
disallow_untyped_calls = false disallow_untyped_calls = false
[tool.ruff] [tool.ruff.lint]
select = [ select = [
"E", # pycodestyle errors "E", # pycodestyle errors
"W", # pycodestyle warnings "W", # pycodestyle warnings
"F", # pyflakes "F", # pyflakes
"I", # isort "I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear "B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade "UP", # pyupgrade
] ]
ignore = [ ignore = [
@ -109,12 +109,12 @@ ignore = [
"W191", # indentation contains tabs "W191", # indentation contains tabs
] ]
[tool.ruff.per-file-ignores] [tool.ruff.lint.per-file-ignores]
# "__init__.py" = ["F401"] # "__init__.py" = ["F401"]
[tool.ruff.isort] [tool.ruff.lint.isort]
known-third-party = ["sqlmodel", "sqlalchemy", "pydantic", "fastapi"] known-third-party = ["sqlmodel", "sqlalchemy", "pydantic", "fastapi"]
[tool.ruff.pyupgrade] [tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`. # Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true keep-runtime-typing = true