Skip to content

fix: Explicitly handle LINK_TO_PROFILE flag in markdown output #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor(markdown): use boolean flag for profile linking and sponsor …
…info

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
  • Loading branch information
Copilot and zkoppert committed Jul 15, 2025
commit e0bc52fe706ef2d7d53d855f9a49c3b15116f687
7 changes: 4 additions & 3 deletions markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def get_contributor_table(
columns = ["Username", "All Time Contribution Count"]
if start_date and end_date:
columns += ["New Contributor"]
if sponsor_info == "true":
# Add Sponsor URL column if sponsor_info is True
if sponsor_info:
columns += ["Sponsor URL"]
if start_date and end_date:
columns += [f"Commits between {start_date} and {end_date}"]
Expand Down Expand Up @@ -191,8 +192,8 @@ def get_contributor_table(
commit_urls += f"{url}, "
new_contributor = collaborator.new_contributor

# Determine prefix for username: hyperlink if link_to_profile equals 'true' (string or bool)
prefix = "@" if str(link_to_profile).strip().lower() == "true" else ""
# Determine prefix for username based on boolean link_to_profile
prefix = "@" if link_to_profile else ""
row = f"| {prefix}{username} | {contribution_count} |"
if "New Contributor" in columns:
row += f" {new_contributor} |"
Expand Down
10 changes: 5 additions & 5 deletions test_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_write_to_markdown(self, mock_file):
"2023-01-02",
None,
"org/repo",
"false",
False,
True,
ghe,
)
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_write_to_markdown_with_sponsors(self, mock_file):
"2023-01-02",
None,
"org/repo",
"true",
True,
True,
ghe,
)
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_write_to_markdown_without_link_to_profile(self, mock_file):
"2023-01-02",
None,
"org/repo",
"false",
False,
False,
ghe,
)
Expand Down Expand Up @@ -216,8 +216,8 @@ def test_write_to_markdown_with_string_false_link_to_profile(self, mock_file):
"2023-01-02",
None,
"org/repo",
"false",
"false",
False,
False,
ghe,
)

Expand Down
Loading