Skip to content

Commit 06469a8

Browse files
committed
ci: email report formatting
~ add new line before summary so that the email is nicely formatted ~ only print sections that have information Signed-off-by: Vitor Bandeira <[email protected]>
1 parent 2303449 commit 06469a8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

flow/util/genReport.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,30 @@ def get_summary(status, text):
194194
'''
195195
TODO: docs
196196
'''
197-
text += '-' * 30 + '\n'
198-
text += ' ' * 7 + f"{status} designs\n"
199-
text += '-' * 30 + '\n'
197+
tmp = ''
200198
for name, data in design_list.items():
201199
if data['status'] == status:
202200
content = gen_report(name, data)
203201
if content != '':
204-
text += content + '\n'
202+
tmp += content + '\n'
205203
# add empty line for readability
206204
if args.verbose >= 2 or status == STATUS_RED:
207-
text += '\n'
205+
tmp += '\n'
206+
if tmp != '':
207+
text += '-' * 30 + '\n'
208+
text += ' ' * 7 + f"{status} designs\n"
209+
text += '-' * 30 + '\n'
210+
text += tmp
211+
208212
return text
209213

210214

211215
def write_summary():
212216
'''
213217
Write summary and individual report files with data on design_list
214218
'''
215-
summary = '=' * 60 + '\n'
219+
summary = '\n'
220+
summary += '=' * 60 + '\n'
216221
summary += ' ' * 26 + 'SUMMARY\n'
217222
summary += '=' * 60 + '\n'
218223
summary += f"\nNumber of designs: {len(design_list.keys())}\n\n"

0 commit comments

Comments
 (0)