chore: re-enable pre-commit

This commit is contained in:
Javier Martinez 2024-07-17 14:13:52 +02:00
parent bdd0bb7425
commit a45c07d2ad
No known key found for this signature in database
2 changed files with 11 additions and 8 deletions

View File

@ -17,13 +17,13 @@ repos:
hooks: hooks:
- id: black - id: black
name: Formatting (black) name: Formatting (black)
entry: black entry: make format
language: system language: system
types: [python] types: [python]
stages: [commit] stages: [commit]
- id: ruff - id: ruff
name: Linter (ruff) name: Linter (ruff)
entry: ruff entry: make lint
language: system language: system
types: [python] types: [python]
stages: [commit] stages: [commit]

View File

@ -12,20 +12,23 @@ test-coverage:
PYTHONPATH=. poetry run pytest tests --cov private_gpt --cov-report term --cov-report=html --cov-report xml --junit-xml=tests-results.xml PYTHONPATH=. poetry run pytest tests --cov private_gpt --cov-report term --cov-report=html --cov-report xml --junit-xml=tests-results.xml
black: black:
poetry run black . --check PYTHONPATH=. poetry run black . --check
ruff: ruff:
poetry run ruff check private_gpt tests PYTHONPATH=. poetry run ruff check private_gpt tests
format: format:
poetry run black . PYTHONPATH=. poetry run black .
poetry run ruff check private_gpt tests --fix
lint:
PYTHONPATH=. poetry run ruff check private_gpt tests --fix
mypy: mypy:
poetry run mypy private_gpt PYTHONPATH=. poetry run mypy private_gpt
check: check:
make format make format
make lint
make mypy make mypy
######################################################################################################################## ########################################################################################################################