| 39 | issues = [x for x in issues if x not in prs] |
| 40 | |
| 41 | def print_list(title, items): |
| 42 | print() |
| 43 | print(title) |
| 44 | print("-"*len(title)) |
| 45 | print() |
| 46 | |
| 47 | for issue in items: |
| 48 | msg = "* `#{0} <{1}>`__: {2}" |
| 49 | # sanitize whitespace, `, and * |
| 50 | title = re.sub("\\s+", " ", issue.title.strip()) |
| 51 | title = title.replace('`', '\\`').replace('*', '\\*') |
| 52 | if len(title) > 60: |
| 53 | remainder = re.sub("\\s.*$", "...", title[60:]) |
| 54 | if len(remainder) > 20: |
| 55 | remainder = title[:80] + "..." |
| 56 | else: |
| 57 | title = title[:60] + remainder |
| 58 | msg = msg.format(issue.id, issue.url, title) |
| 59 | print(msg) |
| 60 | print() |
| 61 | |
| 62 | msg = f"Issues closed for {args.milestone}" |
| 63 | print_list(msg, issues) |