File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2+ from __future__ import annotations
23
34import re
45
2930)
3031issues = (issue for page in issues_pages for issue in page )
3132missing = []
33+ cats_descr = {
34+ "feat" : "New Features" ,
35+ "fix" : "Bug fixes" ,
36+ "fix(types)" : "" ,
37+ "fix(cmake)" : "" ,
38+ "docs" : "Documentation" ,
39+ "tests" : "Tests" ,
40+ "ci" : "CI" ,
41+ "chore" : "Other" ,
42+ "unknown" : "Uncategorised" ,
43+ }
44+ cats : dict [str , list [str ]] = {c : [] for c in cats_descr }
3245
3346for issue in issues :
3447 changelog = ENTRY .findall (issue .body or "" )
3548 if not changelog or not changelog [0 ]:
3649 missing .append (issue )
3750 else :
3851 (msg ,) = changelog
52+ if msg .startswith ("- " ):
53+ msg = msg [2 :]
3954 if not msg .startswith ("* " ):
4055 msg = "* " + msg
4156 if not msg .endswith ("." ):
4257 msg += "."
4358
4459 msg += f"\n `#{ issue .number } <{ issue .html_url } >`_"
60+ for cat in cats :
61+ if issue .title .lower ().startswith (f"{ cat } :" ):
62+ cats [cat ].append (msg )
63+ break
64+ else :
65+ cats ["unknown" ].append (msg )
4566
46- print (Syntax (msg , "rst" , theme = "ansi_light" , word_wrap = True ))
67+ for cat , msgs in cats .items ():
68+ if msgs :
69+ desc = cats_descr [cat ]
70+ print (f"[bold]{ desc } :\n " if desc else "" )
71+ for msg in msgs :
72+ print (Syntax (msg , "rst" , theme = "ansi_light" , word_wrap = True ))
4773 print ()
4874
4975if missing :
You can’t perform that action at this time.
0 commit comments