50 lines
1.2 KiB
Makefile
50 lines
1.2 KiB
Makefile
# NAC Makefile Template
|
||
# 将此文件内容添加到项目的Makefile中
|
||
|
||
.PHONY: lint lint-fix build test clean
|
||
|
||
# NAC Lint检查
|
||
lint:
|
||
@echo "🔍 Running NAC Lint check..."
|
||
@python3 memory/tools/nac_lint.py check --path src/ --verbose
|
||
|
||
# NAC Lint检查(JSON输出)
|
||
lint-json:
|
||
@echo "🔍 Running NAC Lint check (JSON output)..."
|
||
@python3 memory/tools/nac_lint.py check --path src/ --output json --output-file lint-report.json
|
||
|
||
# 列出所有规则
|
||
lint-rules:
|
||
@python3 memory/tools/nac_lint.py list-rules
|
||
|
||
# 带Lint检查的构建
|
||
build: lint
|
||
@echo "🔨 Building project..."
|
||
@cargo build
|
||
|
||
# 带Lint检查的测试
|
||
test: lint
|
||
@echo "🧪 Running tests..."
|
||
@cargo test
|
||
|
||
# 清理
|
||
clean:
|
||
@echo "🧹 Cleaning..."
|
||
@cargo clean
|
||
@rm -f lint-report.json
|
||
|
||
# 安装Git Hook
|
||
install-hooks:
|
||
@echo "📦 Installing Git hooks..."
|
||
@cp memory/tools/pre-commit .git/hooks/pre-commit
|
||
@chmod +x .git/hooks/pre-commit
|
||
@echo "✅ Git hooks installed"
|
||
|
||
# 使用示例:
|
||
# make lint - 运行NAC Lint检查
|
||
# make lint-json - 运行NAC Lint检查并生成JSON报告
|
||
# make lint-rules - 列出所有检查规则
|
||
# make build - 先检查再构建
|
||
# make test - 先检查再测试
|
||
# make install-hooks - 安装Git pre-commit hook
|