Skip to content

Commit eb7d99e

Browse files
committed
Removed unused imports, added pytest to dev dependencies, minor docs change to whitespace
1 parent ac2e280 commit eb7d99e

8 files changed

+12
-22
lines changed

SUPPORT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
66

7-
For help or questions about using this project, please search the existing discussions and issues, then open a new discussion. Thanks!
7+
For help or questions about using this project, please search the existing discussions and issues, then open a new discussion. Thanks!
88

99
This project is actively developed and is maintained by GitHub staff **AND THE COMMUNITY** on a best-effort basis. We will do our best to respond to support and community questions in a timely manner.
1010

dev-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
types-requests==2.32.0.20240914
2-
types-tqdm==4.66.0.20240417
2+
types-tqdm==4.66.0.20240417
3+
pytest==9.0.1

githubapi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
import traceback
1212
import zoneinfo
1313
from urllib.parse import urlunparse, urlencode, urlparse, parse_qs
14-
from typing import Generator, Any
15-
from collections import namedtuple
14+
from typing import Generator
1615
from tqdm import tqdm # type: ignore
1716
import requests # type: ignore
1817

list_secret_scanning_alerts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def decorate_alerts(g: GitHub, alerts: Generator[dict[str, Any], None, None], in
194194
if first_location is not None:
195195
commit_url = first_location.get("commit_url")
196196
if commit_url:
197+
result = None
197198
try:
198199
result = g._get(commit_url)
199200
commit_info = result.json()

replay_code_scanning_alert_status.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44

55
import sys
66
import argparse
7-
import re
87
import logging
9-
import datetime
10-
import json
11-
from typing import Generator, Iterable
12-
from collections import defaultdict
8+
from typing import Iterable
139
from defusedcsv import csv # type: ignore
1410
from githubapi import GitHub, parse_date
1511
from list_code_scanning_alerts import list_code_scanning_alerts

replay_secret_scanning_result_status.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99

1010
import sys
1111
import argparse
12-
import re
1312
import logging
14-
import datetime
15-
import json
16-
from typing import Generator
17-
from collections import defaultdict
1813
from defusedcsv import csv # type: ignore
1914
from githubapi import GitHub, parse_date
2015
from list_secret_scanning_alerts import list_secret_scanning_alerts
@@ -170,6 +165,9 @@ def main() -> None:
170165

171166
results = list_secret_scanning_alerts(name, scope, hostname, state=state, since=since, verify=verify)
172167

168+
if not results:
169+
return
170+
173171
for result in results:
174172
repo = result["repo"]
175173
secret = result["secret"]

resolve_duplicate_secret_scanning_alerts.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22

33
"""Resolve duplicate secret scanning alerts for a GitHub repository, organization or Enterprise."""
44

5-
import sys
65
import argparse
7-
import re
86
import logging
9-
import datetime
107
import json
11-
from typing import Generator, List, Tuple, Iterable
12-
from collections import defaultdict
13-
from defusedcsv import csv # type: ignore
8+
from typing import Iterable
149
from githubapi import GitHub, parse_date
1510
from list_secret_scanning_alerts import list_secret_scanning_alerts
1611

test_resolve_duplicate_secret_scanning_alerts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from resolve_duplicate_secret_scanning_alerts import main
44

55
import argparse
6-
import logging
7-
86

7+
# Uncomment for debugging tests:
8+
# import logging
99
# logging.getLogger("resolve_duplicate_secret_scanning_alerts").setLevel(logging.DEBUG)
1010

1111

0 commit comments

Comments
 (0)