feat(tasks): improve Taskfile with new formatting and testing tasks for Python and frontend

This commit is contained in:
2026-01-03 10:38:14 -06:00
parent 5918d0bcbe
commit 8d87a61e67

View File

@@ -72,14 +72,35 @@ tasks:
- "{{.NPM}} run lint" - "{{.NPM}} run lint"
lint: lint:
desc: Run all linters desc: Run all linters (frontend and Python)
deps: [lint-frontend, lint-python] deps: [lint-frontend, lint-python]
format-python:
desc: Format Python code using ruff
cmds:
- poetry run ruff format ./ --exclude tests
- poetry run ruff check --fix ./ --exclude tests
format-frontend:
desc: Format frontend code using Prettier and ESLint
cmds:
- "{{.NPM}} run format"
- "{{.NPM}} run lint:fix"
format:
desc: Format all code (Python and frontend)
deps: [format-python, format-frontend]
test-python: test-python:
desc: Run Python tests using pytest desc: Run Python tests using pytest
cmds: cmds:
- poetry run pytest tests/backend --cov=meshchatx/src/backend - poetry run pytest tests/backend --cov=meshchatx/src/backend
test-python-cov:
desc: Run Python tests with detailed coverage report
cmds:
- poetry run pytest tests/backend --cov=meshchatx/src/backend --cov-report=term-missing
test-frontend: test-frontend:
desc: Run frontend tests using vitest desc: Run frontend tests using vitest
cmds: cmds:
@@ -89,6 +110,10 @@ tasks:
desc: Run all tests desc: Run all tests
deps: [test-python, test-frontend] deps: [test-python, test-frontend]
test:cov:
desc: Run all tests with coverage reports
deps: [test-python-cov, test-frontend]
compile: compile:
desc: Compile Python code to check for syntax errors desc: Compile Python code to check for syntax errors
cmds: cmds:
@@ -130,6 +155,7 @@ tasks:
desc: Build only the frontend desc: Build only the frontend
deps: [node_modules] deps: [node_modules]
cmds: cmds:
- rm -rf meshchatx/public/assets
- "{{.NPM}} run build-frontend" - "{{.NPM}} run build-frontend"
wheel: wheel:
@@ -210,14 +236,6 @@ tasks:
- rm -rf build-dir - rm -rf build-dir
- task: android-clean - task: android-clean
fix:
desc: Format and fix linting issues (Python and frontend)
cmds:
- poetry run ruff format ./ --exclude tests
- poetry run ruff check --fix ./ --exclude tests
- "{{.NPM}} run format"
- "{{.NPM}} run lint:fix"
build-docker: build-docker:
desc: Build Docker image using buildx desc: Build Docker image using buildx
cmds: cmds: