Did some things, made more improvements.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -20,31 +20,46 @@ repos:
|
||||
args: [--autofix]
|
||||
|
||||
# Python backend linting and formatting with ruff
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.6.9
|
||||
- repo: local
|
||||
hooks:
|
||||
# Linter
|
||||
- id: ruff
|
||||
args: [--fix]
|
||||
name: ruff-lint
|
||||
entry: backend/.venv/bin/ruff check --fix
|
||||
language: system
|
||||
files: ^backend/
|
||||
types: [python]
|
||||
args: [--config=backend/pyproject.toml]
|
||||
# Formatter
|
||||
- id: ruff-format
|
||||
name: ruff-format
|
||||
entry: backend/.venv/bin/ruff format
|
||||
language: system
|
||||
files: ^backend/
|
||||
types: [python]
|
||||
args: [--config=backend/pyproject.toml]
|
||||
|
||||
# Python type checking with pyright
|
||||
- repo: https://github.com/RobertCraigie/pyright-python
|
||||
rev: v1.1.384
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pyright
|
||||
name: pyright
|
||||
entry: backend/.venv/bin/pyright
|
||||
language: system
|
||||
files: ^backend/
|
||||
additional_dependencies: [fastapi, uvicorn, sqlalchemy, pydantic]
|
||||
types: [python]
|
||||
args: [--pythonpath=backend/.venv/bin/python, backend]
|
||||
pass_filenames: false
|
||||
|
||||
# Python docstring linting with darglint
|
||||
- repo: https://github.com/terrencepreilly/darglint
|
||||
rev: v1.8.1
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: darglint
|
||||
name: darglint
|
||||
entry: backend/.venv/bin/darglint
|
||||
language: system
|
||||
files: ^backend/.*\.py$
|
||||
types: [python]
|
||||
|
||||
# Custom hook to enforce no types in docstrings
|
||||
- repo: local
|
||||
|
||||
Reference in New Issue
Block a user