-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
76 lines (75 loc) · 2.28 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-toml
- id: check-json
- id: check-yaml
- id: debug-statements # Vérifie les print() et pdb dans le code
- id: check-added-large-files
# Ruff for Python formatting and linting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
name: Ruff Linter
args: ["--fix"] # Automatically fix issues
files: \.py$
stages: [pre-commit]
- id: ruff-format
name: Ruff Formatter
files: \.py$
stages: [pre-commit]
# Mypy to check type annotations
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
args:
- "--explicit-package-bases"
- "--show-error-codes"
- "--ignore-missing-imports"
- "--config-file"
- "mypy.ini"
- repo: local
hooks:
- id: docker-compose-build
name: Docker Compose Build (Development)
entry: |
bash -c "
set -e;
echo 'Setting up environment variables from .env file...';
echo 'Building Docker Compose services...';
docker compose -f docker-compose.yaml build --build-arg ENV=dev;
echo 'All services are built!';
"
language: system
pass_filenames: false
stages: [pre-commit, pre-push]
- id: docker-compose-run
name: Docker Compose Up (Development)
entry: |
bash -c "
set -e
echo 'Starting Docker Compose services until healthy ...'
source .env.intregrated-test
docker compose up -d --wait
echo 'All services are running!'
"
language: system
pass_filenames: false
stages: [pre-commit, pre-push]
- id: integrated-test-dev
name: Pytest
entry: |
bash -c "
set -e;
echo 'Running Pytest inside sample-api ...';
docker compose -f docker-compose.yaml exec -T sample-api uv run pytest;
"
language: system
pass_filenames: false
stages: [pre-commit, pre-push]