-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (78 loc) · 2.58 KB
/
Copy pathMakefile
File metadata and controls
85 lines (78 loc) · 2.58 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Pool Monitor - Local Development Tasks
# =====================================
.PHONY: help lint lint-fix format build clean
# Default target - show help
help:
@echo "Pool Monitor Development Tasks"
@echo "================================"
@echo ""
@echo "Available targets:"
@echo " make lint - Run Super-Linter to check code quality"
@echo " make lint-fix - Auto-fix linting issues (clang-format, prettier)"
@echo " make format - Format C++ and markdown files"
@echo " make build - Build project (LILYGO_T5_V231)"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Before committing, always run: make lint-fix && make lint"
@echo ""
# Run Super-Linter locally (same config as CI)
lint:
@echo "Running Super-Linter..."
@echo "Note: This uses the same configuration as GitHub Actions CI"
@docker run --rm \
-e VALIDATE_ALL_CODEBASE=false \
-e DEFAULT_BRANCH=main \
-e FILTER_REGEX_EXCLUDE=.*/(\.pio|\.vscode|\.platformio|build|lib)/.* \
-e VALIDATE_CPP=true \
-e VALIDATE_MARKDOWN=true \
-e VALIDATE_YAML=true \
-e VALIDATE_JSON=true \
-e VALIDATE_GITHUB_ACTIONS=true \
-e VALIDATE_EDITORCONFIG=true \
-e VALIDATE_GITLEAKS=true \
-e VALIDATE_BASH=true \
-e CPP_FILE_EXTENSIONS=cpp,hpp,h \
-e MARKDOWN_LINT_LINE_LENGTH=130 \
-e WARNINGS_AS_ERRORS=false \
-e LOG_LEVEL=NOTICE \
-v $(PWD):/tmp/lint \
--workdir /tmp/lint \
ghcr.io/super-linter/super-linter:v8.7.0
@echo ""
@echo "✓ Linting complete!"
# Auto-fix common linting issues
lint-fix:
@echo "Auto-fixing linting issues..."
@echo ""
@echo "1. Formatting C++ files with clang-format..."
@clang-format -i src/**/*.cpp src/**/*.hpp 2>/dev/null || \
(find src -name "*.cpp" -o -name "*.hpp" | xargs clang-format -i)
@echo " ✓ C++ files formatted"
@echo ""
@echo "2. Formatting Markdown files with Prettier..."
@npx prettier@3.5.3 --write "**/*.md" \
--ignore-path .gitignore \
--log-level warn
@echo " ✓ Markdown files formatted"
@echo ""
@echo "3. Formatting YAML files with Prettier..."
@npx prettier@3.5.3 --write "**/*.yml" "**/*.yaml" \
--ignore-path .gitignore \
--log-level warn
@echo " ✓ YAML files formatted"
@echo ""
@echo "✓ Auto-fix complete! Now run 'make lint' to verify."
# Format C++ and Markdown files (alias for lint-fix)
format: lint-fix
# Build for LILYGO_T5_V231
build:
@echo "Building for LILYGO_T5_V231..."
@pio run -e LILYGO_T5_V231
@echo ""
@echo "✓ Build complete!"
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
@pio run --target clean
@rm -rf .pio/build
@echo "✓ Clean complete!"