99https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
1010"""
1111
12+ from itertools import permutations
1213from pathlib import Path
1314from typing import Any
1415
2122 "rust" ,
2223]
2324
25+ MULTI_SCOPES = ["|" .join (scope_permutation ) for scope_count in range (2 , len (SCOPES ) + 1 ) for scope_permutation in permutations (SCOPES , scope_count )]
26+ ALL_SCOPES = [* SCOPES , * MULTI_SCOPES ]
27+
2428# CI and Test are excluded from Release Notes
2529CATEGORIES = {
2630 "Feat" : "Features" ,
@@ -53,15 +57,15 @@ def increase_indent(self, flow: bool = False, *_args: Any, **_kwargs: Any) -> No
5357 categories_list : list [dict [str , str | list [str ]]] = []
5458
5559 # First add exclude labels
56- for scope in SCOPES :
60+ for scope in ALL_SCOPES :
5761 exclude_list .append (f"rn: Test({ scope } )" )
5862 exclude_list .append (f"rn: CI({ scope } )" )
5963 exclude_list .extend (["rn: Test" , "rn: CI" ])
6064
6165 # Then add the categories
6266
6367 breaking_label_categories = ["Feat" , "Fix" , "Cut" , "Revert" , "Refactor" , "Bump" ]
64- breaking_labels = [f"rn: { cc_type } ({ scope } )!" for cc_type in breaking_label_categories for scope in SCOPES ]
68+ breaking_labels = [f"rn: { cc_type } ({ scope } )!" for cc_type in breaking_label_categories for scope in ALL_SCOPES ]
6569 breaking_labels .extend (f"rn: { cc_type } !" for cc_type in breaking_label_categories )
6670
6771 categories_list .append (
@@ -80,6 +84,14 @@ def increase_indent(self, flow: bool = False, *_args: Any, **_kwargs: Any) -> No
8084 for scope in SCOPES
8185 )
8286
87+ # Add fixes spanning multiple scopes
88+ categories_list .append (
89+ {
90+ "title" : "Fixed issues in multiple scopes" ,
91+ "labels" : [f"rn: Fix({ scope } )" for scope in MULTI_SCOPES ],
92+ },
93+ )
94+
8395 # Add other fixes
8496 categories_list .append (
8597 {
@@ -92,11 +104,19 @@ def increase_indent(self, flow: bool = False, *_args: Any, **_kwargs: Any) -> No
92104 categories_list .extend (
93105 {
94106 "title" : f"New features and enhancements in { scope } " ,
95- "labels" : [f"rn: Fix ({ scope } )" ],
107+ "labels" : [f"rn: Feat ({ scope } )" ],
96108 }
97109 for scope in SCOPES
98110 )
99111
112+ # Add features spanning multiple scopes
113+ categories_list .append (
114+ {
115+ "title" : "New features and enhancements in multiple scopes" ,
116+ "labels" : [f"rn: Feat({ scope } )" for scope in MULTI_SCOPES ],
117+ },
118+ )
119+
100120 # Add other features
101121 categories_list .append (
102122 {
@@ -105,7 +125,7 @@ def increase_indent(self, flow: bool = False, *_args: Any, **_kwargs: Any) -> No
105125 },
106126 )
107127
108- doc_labels = [f"rn: Doc({ scope } )" for scope in SCOPES ]
128+ doc_labels = [f"rn: Doc({ scope } )" for scope in ALL_SCOPES ]
109129 doc_labels .append ("rn: Doc" )
110130
111131 categories_list .append (
0 commit comments