Skip to content

Commit 9b5ebd3

Browse files
committed
Fix ruff lint errors in new scripts
- Remove unused os import from create-frontend-plugin scaffold.py - Fix import sort order (I001) in analyze-pr.py and triage-prs.py - Rename ambiguous variable l -> lbl (E741) in analyze-pr.py and triage-prs.py
1 parent e808bed commit 9b5ebd3

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

skills/create-frontend-plugin/scripts/scaffold.py

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

1515
import argparse
1616
import json
17-
import os
1817
import subprocess
1918
import sys
2019
from pathlib import Path

skills/overlay/scripts/analyze-pr.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
a structured analysis with priority, assignment, and merge readiness.
77
"""
88

9+
from __future__ import annotations
10+
911
import argparse
1012
import base64
1113
import json
1214
import subprocess
1315
import sys
1416
from datetime import datetime, timezone
1517

16-
1718
DEFAULT_REPO = "redhat-developer/rhdh-plugin-export-overlays"
1819

1920
STALENESS_THRESHOLDS = {
@@ -95,7 +96,7 @@ def fetch_codeowners(repo):
9596

9697
def classify_priority(labels):
9798
"""Classify PR priority based on labels."""
98-
names = [l["name"] for l in labels] if labels else []
99+
names = [lbl["name"] for lbl in labels] if labels else []
99100

100101
if "do-not-merge" in names:
101102
return "skip", "⚫ Skip (do-not-merge)"
@@ -367,7 +368,7 @@ def build_analysis(pr_number, repo):
367368
codeowner_entries = find_codeowner(workspaces, codeowners_content)
368369
codeowners_modified = check_codeowners_modified(files)
369370
source_json_files = check_source_json_modified(files)
370-
is_addition = any(l["name"] == "workspace-addition" for l in labels)
371+
is_addition = any(lbl["name"] == "workspace-addition" for lbl in labels)
371372
staleness = compute_staleness(pr_data.get("updatedAt", ""), priority_key)
372373
approvals = get_approvals(pr_data)
373374
readiness = determine_merge_readiness(
@@ -384,7 +385,7 @@ def build_analysis(pr_number, repo):
384385
"state": pr_data.get("state", ""),
385386
"priority_key": priority_key,
386387
"priority_label": priority_label,
387-
"labels": [l["name"] for l in labels],
388+
"labels": [lbl["name"] for lbl in labels],
388389
"workspaces": workspaces,
389390
"created_at": pr_data.get("createdAt", ""),
390391
"updated_at": pr_data.get("updatedAt", ""),

skills/overlay/scripts/triage-prs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
evaluates assignment status, and generates a grouped triage report.
66
"""
77

8+
from __future__ import annotations
9+
810
import argparse
911
import json
1012
import subprocess
1113
import sys
1214
from datetime import datetime, timezone
1315

14-
1516
DEFAULT_REPO = "redhat-developer/rhdh-plugin-export-overlays"
1617

1718
STALENESS_THRESHOLDS = {
@@ -57,7 +58,7 @@ def fetch_open_prs(repo):
5758

5859
def classify_priority(labels):
5960
"""Classify PR priority based on labels."""
60-
names = [l["name"] for l in labels] if labels else []
61+
names = [lbl["name"] for lbl in labels] if labels else []
6162

6263
if "do-not-merge" in names:
6364
return "skip", "⚫ Skip"
@@ -178,7 +179,7 @@ def build_triage(repo):
178179
"author": author,
179180
"priority_key": priority_key,
180181
"priority_label": priority_label,
181-
"labels": [l["name"] for l in labels],
182+
"labels": [lbl["name"] for lbl in labels],
182183
"plugin": plugin,
183184
"days_stale": days,
184185
"stale_icon": stale_icon,

0 commit comments

Comments
 (0)