-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
97 lines (83 loc) · 2.05 KB
/
Makefile.toml
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
92
93
94
95
96
97
# 格式化代码 , 风格统一
[tasks.format]
command = "cargo"
args = ["fmt", "--", "--emit=files"]
# 依赖检查
[tasks.deny]
install_crate="cargo-deny"
command = "cargo"
args = ["deny" , "check"]
dependencies = ["format"]
# 拼写检查
[tasks.typos]
install_crate="typos-cli"
command = "typos"
dependencies = ["deny"]
# 编译检查
[tasks.check]
command = "cargo"
args = ["check" , "--all"]
dependencies = ["typos"]
# 代码风格检查
[tasks.clippy]# 一种代码风格检查工具
command = "cargo"
args = ["clippy" , "--all-features" , "--tests" , "--benches" , "--", "-D" , "warnings"]
dependencies = ["check"]
# 运行单元测试
[tasks.test]
install_crate="cargo-nextest"
command = "cargo"
# 允许不存在单元测试
args = ["nextest" , "run" , "--no-tests=pass"]
dependencies = ["clippy"]
# 更改文件加入到 git
[tasks.add]
command="git"
args=["add" , "."]
# 提交并添加 command 信息
[tasks.gitcommit]
command = "git"
args = ["commit", "-a"]
dependencies = ["add"]
# 根据提交信息生成changelog
[tasks.cliff]
install_crate="git-cliff"
command = "git"
args = ["cliff" , "-o" , "CHANGELOG.md"]
# 确保 changelog 被包含在提交中
[tasks.addchange]
command="git"
args=["commit" , "-a" , "-m" , "\"[skip] update changelog\""]
dependencies = ["cliff"]
# 检查之后执行 commit
[tasks.commit]
dependencies = [
"add",
"gitcommit",
"addchange"
]
# cargo release
# 小版本发布
[tasks.patch]
install_crate="cargo-release"
command = "cargo"
args = ["release" , "patch" , "--no-publish", "--execute"]
# dependencies = ["gitcommit"]
# 中版本发布
[tasks.minor]
install_crate="cargo-release"
command = "cargo"
args = ["release" , "minor" , "--no-publish", "--execute"]
# dependencies = ["gitcommit"]
# 大版本发布
[tasks.major]
install_crate="cargo-release"
command = "cargo"
args = ["release" , "major" , "--no-publish", "--execute"]
# dependencies = ["gitcommit"]
# 直接 push
[tasks.push]
install_crate="cargo-release"
command = "cargo"
args = ["release", "--no-publish", "--execute"]
# dependencies = ["gitcommit"]