diff --git a/issue_metrics.py b/issue_metrics.py index a1b3f11..ab9cb91 100644 --- a/issue_metrics.py +++ b/issue_metrics.py @@ -281,6 +281,7 @@ def main(): # pragma: no cover search_query=search_query, hide_label_metrics=False, hide_items_closed_count=False, + enable_mentor_count=enable_mentor_count, non_mentioning_links=False, report_title=report_title, output_file=output_file, @@ -307,6 +308,7 @@ def main(): # pragma: no cover search_query=search_query, hide_label_metrics=False, hide_items_closed_count=False, + enable_mentor_count=enable_mentor_count, non_mentioning_links=False, report_title=report_title, output_file=output_file, @@ -370,6 +372,7 @@ def main(): # pragma: no cover search_query=search_query, hide_label_metrics=hide_label_metrics, hide_items_closed_count=hide_items_closed_count, + enable_mentor_count=enable_mentor_count, non_mentioning_links=non_mentioning_links, report_title=report_title, output_file=output_file, diff --git a/markdown_writer.py b/markdown_writer.py index e506a4f..ed0d05d 100644 --- a/markdown_writer.py +++ b/markdown_writer.py @@ -100,6 +100,7 @@ def write_to_markdown( search_query=None, hide_label_metrics=False, hide_items_closed_count=False, + enable_mentor_count=False, non_mentioning_links=False, report_title="", output_file="", @@ -168,6 +169,7 @@ def write_to_markdown( file, hide_label_metrics, hide_items_closed_count, + enable_mentor_count, ) # Write second table with individual issue/pr/discussion metrics @@ -243,6 +245,7 @@ def write_overall_metrics_tables( file, hide_label_metrics, hide_items_closed_count=False, + enable_mentor_count=False, ): """Write the overall metrics tables to the markdown file.""" if any( @@ -316,5 +319,6 @@ def write_overall_metrics_tables( file.write(f"| Number of items that remain open | {num_issues_opened} |\n") if not hide_items_closed_count: file.write(f"| Number of items closed | {num_issues_closed} |\n") - file.write(f"| Number of most active mentors | {num_mentor_count} |\n") + if enable_mentor_count: + file.write(f"| Number of most active mentors | {num_mentor_count} |\n") file.write(f"| Total number of items created | {len(issues_with_metrics)} |\n\n") diff --git a/test_markdown_writer.py b/test_markdown_writer.py index 3927106..e8f5b08 100644 --- a/test_markdown_writer.py +++ b/test_markdown_writer.py @@ -129,7 +129,6 @@ def test_write_to_markdown(self): "| --- | ---: |\n" "| Number of items that remain open | 2 |\n" "| Number of items closed | 1 |\n" - "| Number of most active mentors | 5 |\n" "| Total number of items created | 2 |\n\n" "| Title | URL | Author | Time to first response | Time to close |" " Time to answer | Time in draft | Time spent in bug | Created At |\n" @@ -240,7 +239,6 @@ def test_write_to_markdown_with_vertical_bar_in_title(self): "| --- | ---: |\n" "| Number of items that remain open | 2 |\n" "| Number of items closed | 1 |\n" - "| Number of most active mentors | 5 |\n" "| Total number of items created | 2 |\n\n" "| Title | URL | Author | Time to first response | Time to close |" " Time to answer | Time in draft | Time spent in bug | Created At |\n" @@ -369,6 +367,7 @@ def test_writes_markdown_file_with_non_hidden_columns_only(self): search_query="repo:user/repo is:issue", hide_label_metrics=True, hide_items_closed_count=True, + enable_mentor_count=True, non_mentioning_links=True, report_title="Issue Metrics", output_file="issue_metrics.md",