Skip to content

Commit 3aedbbe

Browse files
author
Really Him
committed
chore: add make commands for running antipasta on repo
1 parent 42f9d3c commit 3aedbbe

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,38 @@ test-cov: install-dev ## Run tests with coverage report
6969

7070
check: lint type-check test ## Run all quality checks (lint, type-check, test)
7171

72+
# Antipasta metrics analysis targets
73+
74+
metrics: install ## Run antipasta metrics analysis on src/ (verbose)
75+
@echo "Running complexity analysis on src/..."
76+
@$(VENV_DIR)/bin/antipasta metrics -d src/ || (echo ""; echo "❌ Code complexity check FAILED"; exit 2)
77+
@echo ""
78+
@echo "✅ Code complexity check PASSED"
79+
80+
metrics-quiet: install ## Run antipasta metrics analysis on src/ (quiet mode - violations only)
81+
@$(VENV_DIR)/bin/antipasta metrics -d src/ -q || exit 2
82+
83+
metrics-json: install ## Run antipasta metrics analysis and output JSON
84+
@$(VENV_DIR)/bin/antipasta metrics -d src/ --format json
85+
86+
metrics-report: install ## Generate detailed metrics report with statistics
87+
@echo "═══════════════════════════════════════════════════════"
88+
@echo " ANTIPASTA METRICS REPORT"
89+
@echo "═══════════════════════════════════════════════════════"
90+
@echo ""
91+
@echo "📊 Overall Statistics:"
92+
@$(VENV_DIR)/bin/antipasta stats -p "src/**/*.py" -m cyc -m cog -m mai | head -20
93+
@echo ""
94+
@echo "📁 Metrics by Module:"
95+
@$(VENV_DIR)/bin/antipasta stats -p "src/**/*.py" --by-module -m cyc -m cog -m mai
96+
@echo ""
97+
@echo "⚠️ Violations:"
98+
@$(VENV_DIR)/bin/antipasta metrics -d src/ -q 2>&1 | grep -E "^❌" | head -10 || echo "No violations found"
99+
@echo ""
100+
@$(VENV_DIR)/bin/antipasta metrics -d src/ -q > /dev/null 2>&1 && echo "✅ PASS: All metrics within thresholds" || echo "❌ FAIL: $(shell $(VENV_DIR)/bin/antipasta metrics -d src/ -q 2>&1 | grep -c '^❌') violations found"
101+
102+
check-all: check metrics-quiet ## Run all checks including complexity metrics
103+
72104
clean: ## Clean up build artifacts and cache files
73105
rm -rf build dist *.egg-info
74106
rm -rf .pytest_cache .mypy_cache .ruff_cache

0 commit comments

Comments
 (0)