-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
64 lines (59 loc) · 1.85 KB
/
.pre-commit-config.yaml
File metadata and controls
64 lines (59 loc) · 1.85 KB
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
# Pre-commit hooks configuration
# Instalar: pre-commit install
# Ejecutar manualmente: pre-commit run --all-files
repos:
# Hooks generales
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: mixed-line-ending
args: ['--fix=lf']
# Black - Formateo de código
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
args: ['--line-length=88']
files: ^(api|tests)/.*\.py$
# Flake8 - Linting
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ['--max-line-length=88', '--extend-ignore=E203,W503']
files: ^(api|tests)/.*\.py$
# MyPy - Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
- types-redis==4.6.0.20240425
- types-requests==2.31.0.20240125
- pydantic==2.5.3
- pydantic-settings==2.1.0
- fastapi==0.109.0
- httpx==0.26.0
args: ['--python-version=3.11', '--config-file=pyproject.toml']
files: ^api/.*\.py$
exclude: ^tests/
# Pytest - Tests rápidos (solo si hay cambios en tests/)
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: bash -c 'if [ -d ".venv" ]; then .venv/Scripts/python.exe -m pytest tests/ -v --tb=short -x || exit 0; else pytest tests/ -v --tb=short -x || exit 0; fi'
language: system
pass_filenames: false
always_run: false
files: ^(api|tests)/.*\.py$
stages: [manual]