-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (49 loc) · 1.73 KB
/
Makefile
File metadata and controls
58 lines (49 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Makefile for code quality and formatting
# Define color codes
RED := \033[0;31m
GREEN := \033[0;32m
YELLOW := \033[1;33m
NC := \033[0m # No Color
# Default target - run both lint and test
all: lint test
# Run tests
# TODO
# Run all linting and formatting with auto-fix
lint: ruff-lint format eslint prettier
# Run ESLint on frontend code with auto-fix
eslint:
cd frontend && npx eslint --fix src/
# Run Prettier on frontend code with auto-fix
prettier:
cd frontend && npx prettier --write "src/**/*.{ts,tsx,js,jsx,css,json}"
# Run ruff linting checks and fix issues automatically
ruff-lint:
ruff check --fix
# Format Python code according to project standards
format:
ruff format
# CI/CD version of lint that only checks but doesn't modify files
# Used in CI pipelines to verify code quality without making changes
lint-cicd:
@echo "Running code quality checks..."
@if ! ruff check; then \
echo -e "$(RED)ERROR: Ruff linting failed!$(NC)"; \
echo -e "$(YELLOW)Please run 'make ruff-lint' locally to fix these issues.$(NC)"; \
exit 1; \
fi
@if ! ruff format --check; then \
echo -e "$(RED)ERROR: Code formatting check failed!$(NC)"; \
echo -e "$(YELLOW)Please run 'make format' locally to fix these issues.$(NC)"; \
exit 1; \
fi
@cd frontend && if ! npx eslint src/; then \
echo -e "$(RED)ERROR: ESLint check failed!$(NC)"; \
echo -e "$(YELLOW)Please run 'make eslint' locally to fix these issues.$(NC)"; \
exit 1; \
fi
@cd frontend && if ! npx prettier --check "src/**/*.{ts,tsx,js,jsx,css,json}"; then \
echo -e "$(RED)ERROR: Prettier formatting check failed!$(NC)"; \
echo -e "$(YELLOW)Please run 'make prettier' locally to fix these issues.$(NC)"; \
exit 1; \
fi
@echo -e "$(GREEN)All code quality checks passed!$(NC)"