From 1a0109353a4e801d09c8b106963ba5232ebd6276 Mon Sep 17 00:00:00 2001 From: Isabel Drost-Fromm Date: Thu, 28 Mar 2024 20:05:05 +0100 Subject: [PATCH] Fix linting errors. --- config.py | 3 ++- issue_metrics.py | 7 +------ most_active_mentors.py | 4 +--- test_most_active_mentors.py | 5 +---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/config.py b/config.py index e9b7718..df4f06a 100644 --- a/config.py +++ b/config.py @@ -58,7 +58,7 @@ def __init__( enable_mentor_count: str, min_mentor_comments: str, max_comments_eval: str, - heavily_involved_cutoff: str , + heavily_involved_cutoff: str, search_query: str, ): self.gh_app_id = gh_app_id @@ -102,6 +102,7 @@ def __repr__(self): f"{self.search_query})" ) + def get_bool_env_var(env_var_name: str) -> bool: """Get a boolean environment variable. diff --git a/issue_metrics.py b/issue_metrics.py index 3a8ae12..f3d28a0 100644 --- a/issue_metrics.py +++ b/issue_metrics.py @@ -31,6 +31,7 @@ from json_writer import write_to_json from labels import get_label_metrics, get_stats_time_in_labels from markdown_writer import write_to_markdown +from most_active_mentors import count_comments_per_user, get_mentor_count from time_to_answer import get_stats_time_to_answer, measure_time_to_answer from time_to_close import get_stats_time_to_close, measure_time_to_close from time_to_first_response import ( @@ -40,12 +41,6 @@ from time_to_merge import measure_time_to_merge from time_to_ready_for_review import get_time_to_ready_for_review -from most_active_mentors import ( - count_comments_per_user, - get_mentor_count -) -from config import get_env_vars - def search_issues( search_query: str, github_connection: github3.GitHub diff --git a/most_active_mentors.py b/most_active_mentors.py index 4a5dfb1..5b9acd0 100755 --- a/most_active_mentors.py +++ b/most_active_mentors.py @@ -33,13 +33,11 @@ Count the number of mentors active at least n times """ +from collections import Counter from datetime import datetime from typing import List, Union -from collections import Counter - import github3 - from classes import IssueWithMetrics diff --git a/test_most_active_mentors.py b/test_most_active_mentors.py index 550b988..7c5defd 100755 --- a/test_most_active_mentors.py +++ b/test_most_active_mentors.py @@ -15,10 +15,7 @@ from unittest.mock import MagicMock from classes import IssueWithMetrics -from most_active_mentors import ( - count_comments_per_user, - get_mentor_count, -) +from most_active_mentors import count_comments_per_user, get_mentor_count class TestCountCommentsPerUser(unittest.TestCase):