-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit_make.py
More file actions
259 lines (194 loc) · 8.03 KB
/
commit_make.py
File metadata and controls
259 lines (194 loc) · 8.03 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# 用于说明 commit 的类别,只允许使用下面16个标识。
# ✨ :sparkles: 新功能(feature)
# 🐛 :bug: 修补bug
# 📝 :pencil: 文档(documentation)
# 🎨 :art: 格式(不影响代码运行的变动)
# ♻ :recycle: 重构(即不是新增功能, 也不是修改bug的代码变动)
# ✅ :white_check_mark: 增加测试
# 📦 :package: 构建过程或辅助工具的变动
# ⬆ :arrow_up: 升级依赖
# 💄 :lipstick: 更新UI和样式文件
# 💚 :green_heart: 修改ci构建
# 🔊 :loud_sound: 添加日志
# 🔇 :mute: 删除日志
# 🏷 :label: 添加或更新类型(Flow, TypeScript)
# 🙈 :see_no_evil: 添加或更新.gitignore文件
# 🔧 :wrench: 更改配置文件
# 💬 :speech_balloon: 修改文字
# 🔥 :fire: 删除代码或文件
# 如果你的修改涉及多种类型, 你可以用空格分隔多个type
# 近一周晚归-按学院统计-调用失败
# 返回名字,如果没有名字这一列,list还是有的
# TestResp 设置里面的值 而不是返回覆盖
# putZhTableHeaders
# from top.starp.util import json_util
#
# from top.starp.util import file_util
# from top.starp.util import time_util
# from top.starp.util import mongo_util
# from top.starp.util import time_util
from top.starp.util import k
issue="1"
# def documentation(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.documentation)
# def format(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.format)
# def refactor(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.refactor)
# def test_add(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.test_add)
def package(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.package)
def pencil(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.pencil)
def doc(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.pencil)
def document(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.pencil)
def green_heart(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.green_heart)
def ci(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.green_heart)
def cicd(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.green_heart)
def label(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.label)
def type(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.label)
def type_add(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.label)
def speech_balloon(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.speech_balloon)
def text(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.speech_balloon)
def art(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.art)
def clean(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.art)
def arrow_up(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.arrow_up)
def up(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.arrow_up)
def upgrade(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.arrow_up)
# def upgrade(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.upgrade)
def label(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.label)
# def gitignore(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.gitignore)
# def config(commit_str):
# return commit_str_make(commit_str=commit_str, type_name=k.config)
def speech_balloon(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.speech_balloon)
def art(commit_str):
return commit_str_make(commit_str=commit_str, type_name=k.art)
def feature(commit_str):
# return f":sparkles: {commit_str}"
return commit_str_make(commit_str=commit_str,type_name=k.sparkles)
def sparkles(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.sparkles)
def fire(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.fire)
def delete(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.fire)
def see_no_evil(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.see_no_evil)
def git(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.see_no_evil)
def gitignore(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.see_no_evil)
def white_check_mark(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.white_check_mark)
def test(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.white_check_mark)
def test_add(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.white_check_mark)
def add_test(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.white_check_mark)
# wrench
def wrench(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.wrench)
def mute(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.mute)
def rm_log(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.mute)
def config(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.wrench)
def conf(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.wrench)
def ui(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.lipstick)
def lipstick(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.lipstick)
# def bug(commit_str):
# return f":bug: {commit_str}"
def bug(commit_str):
# commit_str_make(commit_str=commit_str,type_name='bug')
# return f":bug: {commit_str}"
return commit_str_make(commit_str=commit_str,type_name='bug')
def commit_str_make(commit_str="修改代码",type_name='recycle'):
# return f":{type_name}: {issue} {commit_str}"
types=[]
if k.bug in commit_str:
if not type_name==k.bug:
types.append(k.bug)
# types.append(k.bug)
# maybeCommit=bug(commit_str=commit_str)
# maybeCommit=f":{k.bug}: ({issue}) {commit_str}"
# print(maybeCommit)
# f":{k.bu}: ({issue}) {commit_str}"
# typesStr='|'.join(types)
typesStr=f':{type_name}:'
for typeName in types:
# f":{typeName}:"
typesStr+=f" :{typeName}:"
# commit_str=commit_str.replace(i,'')
# return f":{type_name}: ({issue}) {commit_str}"
return f"{typesStr} ({issue}) {commit_str}"
def recycle(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.recycle)
def loud_sound(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.loud_sound)
def log(commit_str):
return commit_str_make(commit_str=commit_str,type_name=k.loud_sound)
def modify(commit_str):
return recycle(commit_str=commit_str)
# return commit_str_make(commit_str=commit_str,type_name=k.recycle)
commit_str="""
java
"""
commit_str_striped=commit_str.strip()
# ss=bug(commit_str_striped)
# ss=recycle(commit_str_striped)
# ss=bug(commit_str_striped)
# ss=recycle(commit_str_striped)
# ss=bug(commit_str_striped)
# ss=recycle(commit_str_striped)
# ss=log(commit_str_striped)
# ss=feature(commit_str_striped)
ss=bug(commit_str_striped)
# ()
ss=log(commit_str_striped)
ss=bug(commit_str_striped)
ss=log(commit_str_striped)
# ss=feature(commit_str_striped)
# ss=recycle(commit_str_striped)
ss=feature(commit_str_striped)
ss=log(commit_str_striped)
ss=feature(commit_str_striped)
ss=bug(commit_str_striped)
ss=feature(commit_str_striped)
ss=recycle(commit_str_striped)
ss=art(commit_str_striped)
ss=feature(commit_str_striped)
ss=bug(commit_str_striped)
ss=feature(commit_str_striped)
ss=bug(commit_str_striped)
# ss=log(commit_str_striped)
# ss=bug(commit_str_striped)
# ss=bug(commit_str_striped)
# ss=bug(commit_str_striped)
# log("page data 失败 log ")
# ResourceWarning
print(ss)