Skip to content

Commit f80f7fc

Browse files
committed
more docs
1 parent 7973950 commit f80f7fc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

github_activity/github_activity.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def generate_all_activity_md(
179179
repositories for that org will be used. If the latter, only the specified
180180
repository will be used. Can also be a URL to a GitHub org or repo.
181181
pattern: str
182-
The expression used to match a release tag
182+
The expression used to match a release tag.
183183
kind : ["issue", "pr"] | None
184184
Return only issues or PRs. If None, both will be returned.
185185
auth : string | None
@@ -200,13 +200,14 @@ def generate_all_activity_md(
200200
If True, strip any text between brackets at the beginning of the issue/PR title.
201201
E.g., [MRG], [DOC], etc.
202202
branch : string | None
203-
The branch or reference name to filter pull requests by
203+
The branch or reference name to filter pull requests by.
204204
205205
Returns
206206
-------
207207
entry: str
208208
The markdown changelog entry for all of the release tags in the repo.
209209
"""
210+
# Get the sha and tag name for each tag in the target repo
210211
with TemporaryDirectory() as td:
211212

212213
subprocess.run(
@@ -222,6 +223,7 @@ def generate_all_activity_md(
222223
.splitlines()
223224
)
224225

226+
# Clean up the raw data
225227
pattern = f"tag: {pattern}"
226228

227229
def filter(datum):
@@ -230,6 +232,8 @@ def filter(datum):
230232

231233
data = [d.split(" | ") for (i, d) in enumerate(data)]
232234
data = [d for d in data if filter(d)]
235+
236+
# Generate a changelog entry for each version and sha range
233237
output = ""
234238

235239
for i in range(len(data) - 1):
@@ -324,12 +328,12 @@ def generate_activity_md(
324328
By default, top-level heading is h1, sections are h2.
325329
With heading_level=2 those are increased to h2 and h3, respectively.
326330
branch : string | None
327-
The branch or reference name to filter pull requests by
331+
The branch or reference name to filter pull requests by.
328332
329333
Returns
330334
-------
331335
entry: str
332-
The markdown changelog entry
336+
The markdown changelog entry.
333337
"""
334338
org, repo = _parse_target(target)
335339

0 commit comments

Comments
 (0)