|
1 | 1 | # FUSION Project Makefile |
2 | 2 | # Provides convenient commands for development and validation |
3 | 3 |
|
4 | | -.PHONY: help install lint test validate clean check-env precommit-install precommit-run |
| 4 | +.PHONY: help install lint test validate clean check-env precommit-install precommit-run lint-frontend validate-frontend |
5 | 5 |
|
6 | 6 | # Default target |
7 | 7 | help: |
|
16 | 16 | @echo " check-env Check if virtual environment is activated" |
17 | 17 | @echo "" |
18 | 18 | @echo "Validation (run before submitting PR):" |
19 | | - @echo " validate Run all pre-commit checks on all files" |
| 19 | + @echo " validate Run all checks (backend + frontend + tests)" |
20 | 20 | @echo " lint Run pre-commit checks on all files" |
| 21 | + @echo " lint-frontend Run frontend linting (ESLint)" |
| 22 | + @echo " validate-frontend Run frontend lint + TypeScript build" |
21 | 23 | @echo " precommit-run Run pre-commit on staged files only" |
22 | 24 | @echo " test Run unit tests with pytest" |
23 | 25 | @echo "" |
@@ -86,13 +88,42 @@ precommit-run: check-env |
86 | 88 | @echo "🔍 Running pre-commit checks on staged files..." |
87 | 89 | pre-commit run |
88 | 90 |
|
| 91 | +# Frontend linting |
| 92 | +lint-frontend: |
| 93 | + @echo "Running frontend ESLint..." |
| 94 | + @if [ -d "frontend" ] && [ -f "frontend/package.json" ]; then \ |
| 95 | + cd frontend && npm run lint; \ |
| 96 | + else \ |
| 97 | + echo "Frontend directory not found, skipping..."; \ |
| 98 | + fi |
| 99 | + |
| 100 | +# Frontend validation (lint + build) |
| 101 | +validate-frontend: |
| 102 | + @echo "Running frontend validation (lint + TypeScript build)..." |
| 103 | + @if [ -d "frontend" ] && [ -f "frontend/package.json" ]; then \ |
| 104 | + cd frontend && npm run lint && npm run build; \ |
| 105 | + else \ |
| 106 | + echo "Frontend directory not found, skipping..."; \ |
| 107 | + fi |
| 108 | + |
89 | 109 | # Full PR validation - run all pre-commit checks on all files |
90 | 110 | validate: check-env |
91 | | - @echo "🚀 Running complete validation (pre-commit + tests)..." |
92 | | - @echo "Running pre-commit checks on all files..." |
| 111 | + @echo "Running complete validation (backend + frontend + tests)..." |
| 112 | + @echo "" |
| 113 | + @echo "=== Backend: Pre-commit checks ===" |
93 | 114 | pre-commit run --all-files |
94 | | - @echo "Running unit tests..." |
| 115 | + @echo "" |
| 116 | + @echo "=== Frontend: Lint + TypeScript build ===" |
| 117 | + @if [ -d "frontend" ] && [ -f "frontend/package.json" ]; then \ |
| 118 | + cd frontend && npm run lint && npm run build; \ |
| 119 | + else \ |
| 120 | + echo "Frontend directory not found, skipping..."; \ |
| 121 | + fi |
| 122 | + @echo "" |
| 123 | + @echo "=== Running unit tests ===" |
95 | 124 | python -m pytest |
| 125 | + @echo "" |
| 126 | + @echo "Validation complete!" |
96 | 127 |
|
97 | 128 | # Lint only - run all pre-commit checks |
98 | 129 | lint: check-env |
|
0 commit comments