- --unsafe
- id: end-of-file-fixer
- id: trailing-whitespace
-- repo: https://github.com/asottile/pyupgrade
- rev: v3.15.0
- hooks:
- - id: pyupgrade
- args:
- - --py3-plus
- - --keep-runtime-typing
-- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.1.1
+- repo: https://github.com/charliermarsh/ruff-pre-commit
+ rev: v0.1.2
hooks:
- id: ruff
args:
- --fix
-- repo: https://github.com/psf/black
- rev: 23.10.0
- hooks:
- - id: black
+ - id: ruff-format
ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
[tool.poetry.group.dev.dependencies]
pytest = "^7.0.1"
mypy = "0.971"
+# Needed by the code generator using templates
black = "^22.10.0"
mkdocs-material = "9.1.21"
pillow = "^9.3.0"
coverage = {extras = ["toml"], version = "^6.2"}
fastapi = "^0.68.1"
requests = "^2.26.0"
-ruff = "^0.1.1"
+ruff = "^0.1.2"
[build-system]
requires = ["poetry-core"]
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
+ "UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
+ "W191", # indentation contains tabs
]
[tool.ruff.per-file-ignores]
[tool.ruff.isort]
known-third-party = ["sqlmodel", "sqlalchemy", "pydantic", "fastapi"]
+
+[tool.ruff.pyupgrade]
+# Preserve types, even if a file imports `from __future__ import annotations`.
+keep-runtime-typing = true
mypy sqlmodel
ruff sqlmodel tests docs_src scripts
-black sqlmodel tests docs_src --check
+ruff format sqlmodel tests docs_src --check