mirror of
https://github.com/allthingslinux/tux.git
synced 2024-10-02 16:43:12 +00:00
b02e1ee5f3
feat(.pre-commit-config.yaml): add pre-commit hooks for yaml, json, toml files and dotenv files for better code quality feat(justfile): add check-types command to run pyright for type checking refactor(pyproject.toml): replace aiopath with aiofiles and add types for aiofiles and psutil, adjust pyright settings for strict type checking
45 lines
849 B
Makefile
45 lines
849 B
Makefile
# Install Poetry
|
|
install-poetry:
|
|
curl -sSL https://install.python-poetry.org | python3 -
|
|
|
|
# Install dependencies
|
|
install:
|
|
poetry install && poetry run pre-commit install && poetry run prisma generate
|
|
|
|
# Prisma-related commands
|
|
generate-prisma:
|
|
poetry run prisma generate
|
|
|
|
migrate-prisma:
|
|
poetry run prisma migrate dev
|
|
|
|
# Run the bot
|
|
run:
|
|
poetry run python tux/main.py
|
|
|
|
# Lint the code using ruff
|
|
lint:
|
|
poetry run ruff check .
|
|
|
|
# Fix linting issues
|
|
lint-fix:
|
|
poetry run ruff --fix .
|
|
|
|
# Type-check the code using pyright
|
|
check-types:
|
|
poetry run pyright
|
|
|
|
# Environment setup
|
|
setup-env:
|
|
@echo "Setting up environment..."
|
|
just install-poetry
|
|
just install
|
|
just lint-fix
|
|
just generate-prisma
|
|
# just prisma-migrate
|
|
|
|
start-docker:
|
|
docker compose up --build -d
|
|
|
|
stop-docker:
|
|
docker compose down
|