-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
91 lines (68 loc) · 1.71 KB
/
justfile
File metadata and controls
91 lines (68 loc) · 1.71 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
86
87
88
89
90
91
# PeekAPI Justfile
# 在 Windows 上使用 PowerShell
set shell := ["powershell", "-NoLogo", "-Command"]
# 默认命令:显示帮助
default:
@just --list
# ===== 运行 =====
# 启动服务器
run:
uv run peekapi
# ===== 测试 =====
# 运行所有测试
test:
uv run pytest -n auto
# 运行单元测试
test-unit:
uv run pytest tests/unit -n auto
# 运行集成测试
test-integration:
uv run pytest tests/integration -n auto
# ===== 打包 =====
# 打包为 exe
build:
uv run pyinstaller peekapi.spec --noconfirm
# 清理构建产物
clean:
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue build, dist
# 打包并显示大小
build-size: build
$size = (Get-ChildItem -Path "dist/peekapi" -Recurse | Measure-Object -Property Length -Sum).Sum / 1MB; Write-Host ("打包完成: {0:N2} MB" -f $size)
# ===== 代码质量 =====
# 格式化代码
format:
uv run ruff format .
# 检查代码
lint:
uv run ruff check . --fix
# 类型检查
check:
uv run basedpyright
# ===== 版本管理 =====
# 版本发布(更新版本号、更新 lock 文件、自动修正标签)
bump:
uv run cz bump
uv lock
git add uv.lock
git commit --amend --no-edit --no-verify
$version = (uv run cz version --project).Trim(); git tag -f "v$version"
git push --tags
# 生成 changelog
changelog:
uv run git-cliff --latest
# ===== prek =====
# 安装 prek hooks
hooks:
uv run prek install
# 更新 prek hooks
update:
uv run prek auto-update
# 从 dev 向 main 创建 PR
pr:
gh pr create --base main --fill
gh pr view --web
# PR 合并后强制同步到 main
sync:
git fetch origin
git reset --hard origin/main
git push origin --force-with-lease