Skip to content

Commit 7eb7f03

Browse files
committed
Reformat
1 parent 6c37c21 commit 7eb7f03

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

github_activity/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"include-opened": False,
2222
"strip-brackets": False,
2323
"all": False,
24-
"ignore-contributor": []
24+
"ignore-contributor": [],
2525
}
2626

2727
parser = argparse.ArgumentParser(description=DESCRIPTION)
@@ -132,9 +132,9 @@
132132
help=("""Whether to include all the GitHub tags"""),
133133
)
134134
parser.add_argument(
135-
'--ignore-contributor',
136-
action='append',
137-
help='Do not include this GitHub username as a contributor in the changelog'
135+
"--ignore-contributor",
136+
action="append",
137+
help="Do not include this GitHub username as a contributor in the changelog",
138138
)
139139

140140
# Hidden argument so that target can be optionally passed as a positional argument
@@ -220,7 +220,7 @@ def main():
220220
include_opened=bool(args.include_opened),
221221
strip_brackets=bool(args.strip_brackets),
222222
branch=args.branch,
223-
ignored_contributors=args.ignore_contributor
223+
ignored_contributors=args.ignore_contributor,
224224
)
225225

226226
if args.all:

github_activity/github_activity.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def generate_all_activity_md(
227227
include_opened=False,
228228
strip_brackets=False,
229229
branch=None,
230-
ignored_contributors: list[str] = None
230+
ignored_contributors: list[str] = None,
231231
):
232232
"""Generate a full markdown changelog of GitHub activity of a repo based on release tags.
233233
@@ -327,7 +327,7 @@ def filter(datum):
327327
include_opened=include_opened,
328328
strip_brackets=strip_brackets,
329329
branch=branch,
330-
ignored_contributors=ignored_contributors
330+
ignored_contributors=ignored_contributors,
331331
)
332332

333333
if not md:
@@ -355,7 +355,7 @@ def generate_activity_md(
355355
strip_brackets=False,
356356
heading_level=1,
357357
branch=None,
358-
ignored_contributors: list[str] = None
358+
ignored_contributors: list[str] = None,
359359
):
360360
"""Generate a markdown changelog of GitHub activity within a date window.
361361
@@ -430,10 +430,8 @@ def generate_activity_md(
430430
data["contributors"] = [[]] * len(data)
431431

432432
def ignored_user(username):
433-
return (
434-
any(fnmatch.fnmatch(username, bot) for bot in BOT_USERS)
435-
or
436-
any(fnmatch.fnmatch(username, user) for user in ignored_contributors)
433+
return any(fnmatch.fnmatch(username, bot) for bot in BOT_USERS) or any(
434+
fnmatch.fnmatch(username, user) for user in ignored_contributors
437435
)
438436

439437
def filter_ignored(userlist):
@@ -496,9 +494,11 @@ def filter_ignored(userlist):
496494
data.at[ix, "contributors"] = sorted(item_contributors)
497495

498496
comment_contributor_counts = pd.Series(comment_helpers).value_counts()
499-
all_contributors |= set(comment_contributor_counts[
500-
comment_contributor_counts >= comment_others_cutoff
501-
].index.tolist())
497+
all_contributors |= set(
498+
comment_contributor_counts[
499+
comment_contributor_counts >= comment_others_cutoff
500+
].index.tolist()
501+
)
502502

503503
# Filter the PRs by branch (or ref) if given
504504
if branch is not None:
@@ -680,7 +680,9 @@ def filter_ignored(userlist):
680680
md += info["md"]
681681

682682
# Add a list of author contributions
683-
all_contributors = sorted(filter_ignored(all_contributors), key=lambda a: str(a).lower())
683+
all_contributors = sorted(
684+
filter_ignored(all_contributors), key=lambda a: str(a).lower()
685+
)
684686
all_contributor_links = []
685687
for iauthor in all_contributors:
686688
author_url = f"https://github.com/search?q=repo%3A{org}%2F{repo}+involves%3A{iauthor}+updated%3A{data.since_dt:%Y-%m-%d}..{data.until_dt:%Y-%m-%d}&type=Issues"

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ def test_cli_ignore_user(tmpdir):
126126
cmd = f"github-activity executablebooks/github-activity --ignore-contributor choldgraf -s v1.0.2 -o {path_output}"
127127
run(cmd.split(), check=True)
128128
md = path_output.read_text()
129-
assert not '@choldgraf' in md
129+
assert not "@choldgraf" in md

0 commit comments

Comments
 (0)