-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (44 loc) · 1.46 KB
/
Copy pathMakefile
File metadata and controls
57 lines (44 loc) · 1.46 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
.DEFAULT_GOAL := help
# Colors for terminal output
RED := \033[0;31m
GREEN := \033[0;32m
YELLOW := \033[1;33m
BLUE := \033[0;34m
NC := \033[0m
# Load variables from .env and export them to all sub-shells
-include .env
export
# --- Variables ---
# Default arguments to pass to cargo commands. Can be overridden from the command line.
# Example: make test-unit ARGS="my_test_name"
# Example: make test ARGS="-- --nocapture"
ARGS ?=
# Base command for running tests to avoid repetition
TEST_CMD_BASE := cargo test -p sqlk-tui --features "test-utils"
# Declare targets that are not files
.PHONY: clean help fmt fix clippy test quality-check run-app
clean:
@echo "Clean"
@cargo clean
help:
@echo "$(BLUE)Available targets:$(NC) $(filter-out help,$(.PHONY))"
run-app:
@echo "$(BLUE)🚀 Running app...$(NC)"
@source ${env} && cargo run -p sqlk -- --env ${env} --file ${file} --toast-level ${level}
fmt:
@echo "$(BLUE)🔎 Checking formatting...$(NC)"
@cargo fmt --all -- --check
fix:
@echo "$(BLUE)🎨 Formatting code...$(NC)"
@cargo fmt --all
@echo "$(BLUE)🔧 Fixing with clippy...$(NC)"
@cargo clippy --fix --all-targets -- -D warnings
clippy:
@echo "$(BLUE)📎 Checking code with Clippy...$(NC)"
@cargo clippy --all-targets -- -D warnings
test:
@echo "$(BLUE)🧪 Running tests...$(NC)"
@$(TEST_CMD_BASE) $(ARGS)
@echo "$(GREEN)✅ All primary tests passed!$(NC)"
quality-check: fmt clippy test
@echo "$(GREEN)✅ All code quality checks passed!$(NC)"