Skip to content

Commit 93ceb73

Browse files
committed
fix: remove mentor count from stats if mentors are disabled
Signed-off-by: Zack Koppert <zkoppert@github.com>
1 parent 0bac475 commit 93ceb73

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

issue_metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ def main(): # pragma: no cover
281281
search_query=search_query,
282282
hide_label_metrics=False,
283283
hide_items_closed_count=False,
284+
enable_mentor_count=enable_mentor_count,
284285
non_mentioning_links=False,
285286
report_title=report_title,
286287
output_file=output_file,
@@ -307,6 +308,7 @@ def main(): # pragma: no cover
307308
search_query=search_query,
308309
hide_label_metrics=False,
309310
hide_items_closed_count=False,
311+
enable_mentor_count=enable_mentor_count,
310312
non_mentioning_links=False,
311313
report_title=report_title,
312314
output_file=output_file,
@@ -370,6 +372,7 @@ def main(): # pragma: no cover
370372
search_query=search_query,
371373
hide_label_metrics=hide_label_metrics,
372374
hide_items_closed_count=hide_items_closed_count,
375+
enable_mentor_count=enable_mentor_count,
373376
non_mentioning_links=non_mentioning_links,
374377
report_title=report_title,
375378
output_file=output_file,

markdown_writer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def write_to_markdown(
100100
search_query=None,
101101
hide_label_metrics=False,
102102
hide_items_closed_count=False,
103+
enable_mentor_count=False,
103104
non_mentioning_links=False,
104105
report_title="",
105106
output_file="",
@@ -168,6 +169,7 @@ def write_to_markdown(
168169
file,
169170
hide_label_metrics,
170171
hide_items_closed_count,
172+
enable_mentor_count,
171173
)
172174

173175
# Write second table with individual issue/pr/discussion metrics
@@ -243,6 +245,7 @@ def write_overall_metrics_tables(
243245
file,
244246
hide_label_metrics,
245247
hide_items_closed_count=False,
248+
enable_mentor_count=False,
246249
):
247250
"""Write the overall metrics tables to the markdown file."""
248251
if any(
@@ -316,5 +319,6 @@ def write_overall_metrics_tables(
316319
file.write(f"| Number of items that remain open | {num_issues_opened} |\n")
317320
if not hide_items_closed_count:
318321
file.write(f"| Number of items closed | {num_issues_closed} |\n")
319-
file.write(f"| Number of most active mentors | {num_mentor_count} |\n")
322+
if enable_mentor_count:
323+
file.write(f"| Number of most active mentors | {num_mentor_count} |\n")
320324
file.write(f"| Total number of items created | {len(issues_with_metrics)} |\n\n")

0 commit comments

Comments
 (0)