@@ -10,6 +10,8 @@ https://github.com/scientific-python/changelist/blob/main/CHANGELOG.md.
10
10
- Compile a list of pull requests, code authors, and reviewers between
11
11
two given git commits.
12
12
- Categorize pull requests into sections based on GitHub labels.
13
+ - Override pull request titles with more descriptive summaries.
14
+ - Document unrelated changes in a pull requests in separate summaries.
13
15
14
16
_ This project is currently in its alpha stage and might be incomplete or change a lot!_
15
17
@@ -33,9 +35,36 @@ changelist scientific-python/changelist v0.2.0 main
33
35
34
36
This will list all pull requests, authors and reviewers that touched commits
35
37
between ` v0.2.0 ` and ` main ` (excluding ` v0.2.0 ` ).
36
- Pull requests are sorted into section according to the configuration in
38
+ Pull requests are sorted into sections according to the configuration in
37
39
` tool.changelist.label_section_map ` .
38
40
41
+ ## Writing pull request summaries
42
+
43
+ By default, changelist will fall back to the title of a pull request and its
44
+ GitHub labels to sort it into the appropriate section. However, if you want
45
+ longer summaries of your changes you can add a code block with the following
46
+ form anywhere in the description of the pull request:
47
+
48
+ ```release-note
49
+ An ideally expressive description of the change that is included as
50
+ a single bullet point. Newlines are removed.
51
+ ```
52
+
53
+ Sometimes pull requests introduce multiple changes that should be listed in different
54
+ sections. For that reason, a summary block like above can be used more than
55
+ once. Additionally, you can add independent labels to each summary by adding a
56
+ ` {label="..."} ` anywhere in the summary. These labels are sorted the same way
57
+ as regular pull request labels are. E.g. the two summaries below will go into
58
+ separate sections:
59
+
60
+ ```release-note {label="Bug fix"}
61
+ Make `is_odd()` work for negative numbers.
62
+ ```
63
+
64
+ ```release-note
65
+ Deprecate `ìs_odd`; use `not (x % 2)` instead! {label="API, Highlight"}
66
+ ```
67
+
39
68
## Configuration
40
69
41
70
changelist can be configured from two sources, in order of precedence:
@@ -79,18 +108,39 @@ ignored_user_logins = [
79
108
]
80
109
81
110
# If this regex matches a pull requests description, the captured content
82
- # is included instead of the pull request title.
83
- # E.g. the default regex below is matched by
111
+ # is included instead of the pull request title. E.g. the
112
+ # default regex below is matched by
84
113
#
85
114
# ```release-note
86
- # An ideally expressive description of the change that is included as a single
87
- # bullet point. Newlines are removed.
115
+ # An ideally expressive description of the change that is included as
116
+ # a single bullet point. Newlines are removed.
88
117
# ```
89
118
#
90
119
# If you modify this regex, make sure to match the content with a capture
91
- # group named "summary".
120
+ # group named "summary". The regex is allowed to match more than once in which
121
+ # case a single pull request may result in multiple items (see
122
+ # `pr_summary_label_regex` for why that might be useful).
92
123
pr_summary_regex = " ^```release-note\\ s*(?P<summary>[\\ s\\ S]*?\\ w[\\ s\\ S]*?)\\ s*^```"
93
124
125
+ # Sometimes pull requests introduce changes that should be listed in different
126
+ # sections. For that reason, `pr_summary_regex` can match more than once and
127
+ # this regex, `pr_summary_label_regex`, can be used to add independent labels
128
+ # to each summary. These labels are sorted with the `label_section_map` the
129
+ # same way as regular pull request labels are. E.g. the example below will both
130
+ # match and go into separate sections:
131
+ #
132
+ # ```release-note {label="Bug fix"}
133
+ # Make `is_odd()` work for negative numbers.
134
+ # ```
135
+ #
136
+ # ```release-note
137
+ # Deprecate `ìs_odd`; use `not (x % 2)` instead! {label="API, Highlight"}
138
+ # ```
139
+ #
140
+ # If you modify this regex, make sure to match the content with a capture
141
+ # group named "label".
142
+ pr_summary_label_regex = """ {[^}]*?label=[\\ "](?P<label>[^\\ "]+)[^}]*?}"""
143
+
94
144
# If any of a pull request's labels matches one of the regexes on the left side
95
145
# its summary will appear in the appropriate section with the title given on
96
146
# the right side. If a pull request doesn't match one of these categories it is
0 commit comments