Skip to content

Commit ccfae8b

Browse files
committed
fix: linting, still 3 mypy errors, very close
Signed-off-by: jmeridth <[email protected]>
1 parent bef0ad3 commit ccfae8b

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ If you need support using this project or have questions about it, please [open
9999
2. Select a best fit workflow file from the [examples directory](./docs/example-workflows.md) for your use case.
100100
3. Copy that example into your repository (from step 1) and into the proper directory for GitHub Actions: `.github/workflows/` directory with the file extension `.yml` (ie. `.github/workflows/issue-metrics.yml`)
101101
4. Edit the values (`SEARCH_QUERY`, `assignees`) from the sample workflow with your information. See the [SEARCH_QUERY](./docs/search-query.md) section for more information on how to configure the search query.
102-
5. If you are running metrics on a repository other than the one where the workflow file is going to be, then update the value of `GH_TOKEN`. Do this by creating a [GitHub API token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with permissions to read the repository and write issues. Then take the value of the API token you just created, and [create a repository secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) where the name of the secret is `GH_TOKEN` and the value of the secret the API token. Then finally update the workflow file to use that repository secret by changing `GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}` to `GH_TOKEN: ${{ secrets.GH_TOKEN }}`. The name of the secret can really be anything. It just needs to match between when you create the secret name and when you refer to it in the workflow file.
102+
5. If you are running metrics on a repository other than the one where the workflow file is going to be, then update the value of `GH_TOKEN`.
103+
- Do this by creating a [GitHub API token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with permissions to read the repository and write issues.
104+
- Then take the value of the API token you just created, and [create a repository secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) where the name of the secret is `GH_TOKEN` and the value of the secret the API token. Then finally update the workflow file to use that repository secret by changing `GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}` to `GH_TOKEN: ${{ secrets.GH_TOKEN }}`. The name of the secret can really be anything. It just needs to match between when you create the secret name and when you refer to it in the workflow file.
103105
6. If you want the resulting issue with the metrics in it to appear in a different repository other than the one the workflow file runs in, update the line `token: ${{ secrets.GITHUB_TOKEN }}` with your own GitHub API token stored as a repository secret. This process is the same as described in the step above. More info on creating secrets can be found [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets).
104106
7. Commit the workflow file to the default branch (often `master` or `main`)
105107
8. Wait for the action to trigger based on the `schedule` entry or manually trigger the workflow as shown in the [documentation](https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow).

labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def get_label_metrics(issue: github3.issues.Issue, labels: List[str]) -> dict:
9292
def get_stats_time_in_labels(
9393
issues_with_metrics: List[IssueWithMetrics],
9494
labels: dict[str, timedelta],
95-
) -> dict[str, dict[str, timedelta | None ]]:
95+
) -> dict[str, dict[str, timedelta | None]]:
9696
"""Calculate stats describing time spent in each label."""
9797
time_in_labels = {}
9898
for issue in issues_with_metrics:

requirements.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
github3.py==4.0.1
2+
numpy==1.26.4
23
python-dotenv==1.0.1
34
pytz==2024.1
4-
Requests==2.31.0
5-
pytest==8.1.1
6-
pytest-cov==5.0.0
7-
flake8==7.0.0
8-
pylint==3.1.0
9-
numpy==1.26.4
5+
requests==2.31.0

test_time_to_answer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import unittest
44
from datetime import timedelta
5-
from typing import List
65

76
from classes import IssueWithMetrics
87
from time_to_answer import get_stats_time_to_answer, measure_time_to_answer

time_to_first_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def ignore_comment(
128128
user_is_ignored: bool = comment_user.login in ignore_users
129129
user_is_a_bot: bool = str(comment_user.type.lower()) == "bot"
130130
user_is_issue_creator: bool = str(comment_user.login) == str(issue_user.login)
131-
issue_was_created_before_ready_for_review: bool = (
132-
ready_for_review_at and (comment_created_at < ready_for_review_at)
131+
issue_was_created_before_ready_for_review: bool = ready_for_review_at and (
132+
comment_created_at < ready_for_review_at
133133
)
134134
result: bool = (
135135
user_is_ignored

0 commit comments

Comments
 (0)