chore: configure python quality tooling
Co-authored-by: OpenAI/GPT-5.6-Terra <vibecoder@antoineve.me> Co-authored-by: OpenAI/GPT-5.6-Luna <vibecoder@antoineve.me>
This commit is contained in:
13
README.md
13
README.md
@@ -74,6 +74,19 @@ Toute la configuration métier se trouve dans `config.toml` :
|
||||
.venv/bin/python -m pytest
|
||||
```
|
||||
|
||||
### Qualité Python
|
||||
|
||||
Ruff est l'unique outil de lint, de tri des imports et de formatage Python :
|
||||
|
||||
```bash
|
||||
.venv/bin/ruff check .
|
||||
.venv/bin/ruff format --check .
|
||||
```
|
||||
|
||||
La configuration se trouve dans `pyproject.toml` (Python 3.10+, lignes de 100
|
||||
caractères). Le formatage peut être appliqué avec `.venv/bin/ruff format .` lors
|
||||
de l'étape de correction dédiée.
|
||||
|
||||
### Import bulk depuis CSV
|
||||
|
||||
Un script est disponible pour importer des entrées en masse depuis un fichier CSV :
|
||||
|
||||
18
pyproject.toml
Normal file
18
pyproject.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
[tool.ruff]
|
||||
target-version = "py310"
|
||||
line-length = 100
|
||||
include = ["*.py"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E4", "E7", "E9", "F", "I"]
|
||||
|
||||
# Ces imports différés sont intentionnels : ils évitent des dépendances
|
||||
# circulaires ou préparent sys.path pour les scripts lancés directement.
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"app/business/time_calc.py" = ["E402"]
|
||||
"scripts/import_csv.py" = ["E402"]
|
||||
"tests/test_time_calc.py" = ["E402"]
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "double"
|
||||
indent-style = "space"
|
||||
@@ -3,3 +3,4 @@ flask-sqlalchemy>=3.1
|
||||
pytest>=8.0
|
||||
pytest-flask>=1.3
|
||||
gunicorn>=22.0
|
||||
ruff>=0.9,<1.0
|
||||
|
||||
Reference in New Issue
Block a user