-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 1.5 KB
/
Makefile
File metadata and controls
69 lines (58 loc) · 1.5 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
.PHONY: install dev test lint format build clean help
# 默认目标
help:
@echo "RealCite - 学术文献引用真实性检测工具"
@echo ""
@echo "可用命令:"
@echo " make install 安装项目"
@echo " make dev 安装开发依赖"
@echo " make test 运行测试"
@echo " make lint 代码检查"
@echo " make format 代码格式化"
@echo " make build 构建发布包"
@echo " make clean 清理临时文件"
@echo " make demo 运行示例演示"
@echo ""
# 安装
install:
pip install -e .
# 安装开发依赖
dev:
pip install -e ".[dev]"
# 运行测试
test:
pytest tests/ -v
# 快速测试(失败即停)
test-fast:
pytest tests/ -v -x --ff
# 代码检查
lint:
ruff check src/ tests/
# 代码格式化
format:
black src/ tests/
ruff check --fix src/ tests/
# 构建发布包
build:
python -m build
# 清理临时文件
clean:
rm -rf build/ dist/ *.egg-info
rm -rf .pytest_cache/ .ruff_cache/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
# 运行示例演示
demo:
@echo "=== 验证真实文献 ==="
realcite tests/fixtures/valid.bib -v
@echo ""
@echo "=== 验证虚假文献 ==="
realcite tests/fixtures/fake.bib -v
@echo ""
@echo "=== 验证混合文献 ==="
realcite tests/fixtures/mixed.bib -v
# 验证示例文件
demo-sample:
realcite examples/sample.bib -v -o examples/report.md
@echo ""
@echo "报告已保存到 examples/report.md"