From 4715f1e0d3717edad6c13a1294c85a6f0978b3d0 Mon Sep 17 00:00:00 2001 From: Paolo Filippelli Date: Wed, 3 Jul 2024 09:30:35 +0200 Subject: [PATCH] feat: add pre-commit linter config file --- .pre-commit-config.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..00ff2a4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +default_language_version: + python: python3.11 +default_stages: [pre-commit, push] +exclude: > + (?x)^( + api/alembic| + api/.venv| + api/tests| + sdk| + spark| + ui + )$ +repos: + - repo: https://github.com/compilerla/conventional-pre-commit + rev: v3.2.0 + hooks: + - id: conventional-pre-commit + stages: [commit-msg] + args: [] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.8 + hooks: + - id: ruff + args: [--config=api/pyproject.toml, --fix] + files: ^((api/app)/.+)?[^/]+\.(py)$ + - id: ruff-format + args: [--config=api/pyproject.toml] + files: ^((api/app)/.+)?[^/]+\.(py)$ \ No newline at end of file