.PHONY: help install qa qa-rust qa-python qa-nodejs coverage bench clean
help:
@echo "Selfware QA Workflows - Available Commands"
@echo ""
@echo "Setup:"
@echo " make install Install all dependencies"
@echo ""
@echo "Quality Assurance:"
@echo " make qa Run full QA pipeline"
@echo " make qa-rust Run Rust QA only"
@echo " make qa-python Run Python QA only"
@echo " make qa-nodejs Run Node.js QA only"
@echo ""
@echo "Testing:"
@echo " make test Run all tests"
@echo " make coverage Generate coverage reports"
@echo " make bench Run benchmarks"
@echo ""
@echo "Maintenance:"
@echo " make clean Clean generated files"
@echo " make format Format all code"
@echo " make lint Run all linters"
@echo " make security Run security scans"
@echo ""
@echo "Reports:"
@echo " make report Generate unified QA report"
@echo " make report-md Generate markdown report"
install:
@echo "Installing dependencies..."
pip install -r requirements.txt 2>/dev/null || true
npm install 2>/dev/null || true
cargo fetch 2>/dev/null || true
qa: qa-rust qa-python qa-nodejs
@echo "โ
Full QA pipeline complete"
qa-rust:
@echo "๐ง Running Rust QA..."
@if [ -f Cargo.toml ]; then \
cargo check --all-features && \
cargo fmt --all -- --check && \
cargo clippy --all-features -- -D warnings && \
cargo test --all-features && \
echo "โ
Rust QA passed"; \
else \
echo "โญ๏ธ No Rust code found"; \
fi
qa-python:
@echo "๐ Running Python QA..."
@if [ -f pyproject.toml ] || [ -f setup.py ]; then \
ruff check src/ tests/ && \
ruff format --check src/ tests/ && \
mypy src/ tests/ && \
pytest --cov=src --cov-report=term-missing && \
echo "โ
Python QA passed"; \
else \
echo "โญ๏ธ No Python code found"; \
fi
qa-nodejs:
@echo "๐ฆ Running Node.js QA..."
@if [ -f package.json ]; then \
npm run lint && \
npm run format:check && \
npm run typecheck && \
npm run test && \
echo "โ
Node.js QA passed"; \
else \
echo "โญ๏ธ No Node.js code found"; \
fi
test: test-rust test-python test-nodejs
@echo "โ
All tests passed"
test-rust:
@echo "๐ง Running Rust tests..."
@cargo test --all-features
test-python:
@echo "๐ Running Python tests..."
@pytest -v
test-nodejs:
@echo "๐ฆ Running Node.js tests..."
@npm test
coverage: coverage-rust coverage-python coverage-nodejs
@echo "โ
Coverage reports generated"
coverage-rust:
@echo "๐ง Generating Rust coverage..."
@cargo tarpaulin --out Html --out Xml
coverage-python:
@echo "๐ Generating Python coverage..."
@pytest --cov=src --cov-report=html --cov-report=xml
coverage-nodejs:
@echo "๐ฆ Generating Node.js coverage..."
@npm run test:coverage
bench: bench-rust bench-python bench-nodejs
@echo "โ
Benchmarks complete"
bench-rust:
@echo "๐ง Running Rust benchmarks..."
@cargo bench
bench-python:
@echo "๐ Running Python benchmarks..."
@pytest --benchmark-only
bench-nodejs:
@echo "๐ฆ Running Node.js benchmarks..."
@npm run test:bench
format: format-rust format-python format-nodejs
@echo "โ
Code formatted"
format-rust:
@echo "๐ง Formatting Rust code..."
@cargo fmt --all
format-python:
@echo "๐ Formatting Python code..."
@ruff format src/ tests/
format-nodejs:
@echo "๐ฆ Formatting Node.js code..."
@npm run format
lint: lint-rust lint-python lint-nodejs
@echo "โ
Linting complete"
lint-rust:
@echo "๐ง Linting Rust code..."
@cargo clippy --all-features -- -D warnings
lint-python:
@echo "๐ Linting Python code..."
@ruff check src/ tests/
lint-nodejs:
@echo "๐ฆ Linting Node.js code..."
@npm run lint
security: security-rust security-python security-nodejs
@echo "โ
Security scans complete"
security-rust:
@echo "๐ง Scanning Rust dependencies..."
@cargo audit
security-python:
@echo "๐ Scanning Python dependencies..."
@bandit -r src/ || true
@safety check || true
security-nodejs:
@echo "๐ฆ Scanning Node.js dependencies..."
@npm audit --audit-level=moderate
report:
@echo "๐ Generating unified QA report..."
@python scripts/qa-orchestrator.py \
--action aggregate \
--config selfware-qa-schema.yaml \
--reports-dir reports/ \
--output reports/unified-report.json
report-md:
@echo "๐ Generating markdown report..."
@node scripts/report-aggregator.js \
--report reports/unified-report.json \
--format markdown \
--output reports/qa-report.md
clean:
@echo "๐งน Cleaning generated files..."
@rm -rf target/ 2>/dev/null || true
@rm -rf dist/ 2>/dev/null || true
@rm -rf build/ 2>/dev/null || true
@rm -rf __pycache__/ 2>/dev/null || true
@rm -rf .pytest_cache/ 2>/dev/null || true
@rm -rf .mypy_cache/ 2>/dev/null || true
@rm -rf coverage/ 2>/dev/null || true
@rm -rf htmlcov/ 2>/dev/null || true
@rm -rf *.egg-info/ 2>/dev/null || true
@rm -rf node_modules/ 2>/dev/null || true
@rm -f .coverage 2>/dev/null || true
@rm -f cobertura.xml 2>/dev/null || true
@rm -f coverage.xml 2>/dev/null || true
@cargo clean 2>/dev/null || true
@echo "โ
Clean complete"
dev-rust:
@echo "๐ง Starting Rust development..."
@cargo watch -x check -x test
dev-python:
@echo "๐ Starting Python development..."
@ptw --runner pytest
dev-nodejs:
@echo "๐ฆ Starting Node.js development..."
@npm run dev
ci-rust: format-rust lint-rust test-rust coverage-rust
@echo "โ
Rust CI checks complete"
ci-python: format-python lint-python test-python coverage-python
@echo "โ
Python CI checks complete"
ci-nodejs: format-nodejs lint-nodejs test-nodejs coverage-nodejs
@echo "โ
Node.js CI checks complete"