Skip to content

Commit 2a56a63

Browse files
authored
Change ignore_pull_request from list to set
1 parent 49bebbf commit 2a56a63

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

‎scripts/pr_file_map.py‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
DIRECTORY_FILE = "DIRECTORY.md"
5353

5454
# Open PRs to skip in the report, e.g. [123, 456, 789] ignores #123, #456, #789.
55-
ignore_pull_request: list[int] = []
55+
ignore_pull_request: set[int] = {15105, 15142, 15356}
5656

5757

5858
def run_gh(args: list[str]) -> str:
@@ -114,7 +114,7 @@ def get_open_prs() -> list[dict]:
114114
raw = run_gh(
115115
["pr", "list", "--state", "open", "--limit", "1000", "--json", "number,title"]
116116
)
117-
ignore = set(ignore_pull_request)
117+
ignore = ignore_pull_request
118118
return [pr for pr in json.loads(raw) if pr["number"] not in ignore]
119119

120120

@@ -199,12 +199,6 @@ def render_directory_section(
199199

200200

201201
def main() -> None:
202-
# Reuse the shared progress() helper from other/cheap_progress.py. It lives at
203-
# the repo root, which is not on sys.path when this script runs directly, so
204-
# add the repo root before importing rather than duplicating the helper here.
205-
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
206-
from other.cheap_progress import progress
207-
208202
if shutil.which("gh") is None:
209203
sys.exit("Error: 'gh' (GitHub CLI) is not installed or not in PATH.")
210204

@@ -218,7 +212,7 @@ def main() -> None:
218212
pr_to_files: dict[int, list[str]] = {}
219213
touch_count = 0 # every (PR, file) pair; a file may be touched by many PRs
220214

221-
for pr in progress(prs, desc="First pass"):
215+
for pr in prs:
222216
pr_number = pr["number"]
223217
pr_files = get_pr_files(pr_number)
224218
pr_to_files[pr_number] = pr_files
@@ -240,7 +234,7 @@ def main() -> None:
240234
missing: dict[str, list[int]] = {}
241235
contested: dict[str, list[int]] = {}
242236

243-
for path, pr_numbers in progress(file_to_prs.items(), desc="Second pass"):
237+
for path, pr_numbers in file_to_prs.items():
244238
deduped = sorted(set(pr_numbers))
245239
target = existing if Path(path).exists() else missing
246240
target[path] = deduped

0 commit comments

Comments
 (0)