linus666

Untitled

Aug 10th, 2025
1,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.58 KB | None | 0 0
  1. .PHONY: format lint check help
  2.  
  3. CODE = .
  4. APPLICATION_NAME = promoter_app
  5.  
  6.  
  7. env:  ##@Environment Create .env file with variables
  8.     @$(eval SHELL:=/bin/bash)
  9.     @cp .env.example .env
  10.  
  11.  
  12. format: ##@Code Format code with ruff
  13.     ruff format $(CODE)
  14.  
  15. check: ##@Code Check code with ruff
  16.     ruff check $(CODE)
  17.  
  18. lint: ##@Code Check code with ruff (alias for check)
  19.     ruff check --fix $(CODE)
  20.  
  21. build: ##@Docker Build Docker images
  22.     docker-compose build
  23.  
  24. up: ##@Docker Start all services
  25.     docker-compose up -d
  26.  
  27. run:
  28.     python3 -m $(APPLICATION_NAME)
  29.  
  30. revision:
  31.     alembic -c $(APPLICATION_NAME)/core/db/alembic.ini revision --autogenerate
  32.  
  33. head:
  34.     alembic -c $(APPLICATION_NAME)/core/db/alembic.ini upgrade head
  35.  
  36. test: ##@Testing Run all tests
  37.     uv run pytest
  38.  
  39. test-cov-branch: ##@Testing Run tests with branch coverage
  40.     uv run pytest --cov=promoter_app --cov-report=term-missing --cov-branch
  41.  
  42. clean:  ##@Code Clean directory from garbage files
  43.     rm -fr *.egg-info dist
  44.  
  45.  
  46. help:
  47.     @echo "Доступные команды:"
  48.     @echo "  format      - Форматирование кода"
  49.     @echo "  check       - Проверка кода без исправлений"
  50.     @echo "  lint        - Проверка и автоисправление"
  51.     @echo "  run         - Запуск приложения"
  52.     @echo "  build       - Собрать Docker образы"
  53.     @echo "  up          - Запустить все сервисы"
  54.     @echo "  test        - Запуск тестов"
  55.     @echo "  test-cov    - Тесты с покрытием"
  56.     @echo "  clean       - Очистка от garbage"
  57.  
Advertisement
Add Comment
Please, Sign In to add comment