Skip to content

Commit d84ce0a

Browse files
committed
Fix linter errors
1 parent 743d0ae commit d84ce0a

2 files changed

Lines changed: 15 additions & 21 deletions

File tree

skills/rhdh-test-plan-review/scripts/check_gsheets.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import shutil
88
import subprocess
99
import sys
10-
from pathlib import Path
11-
1210

1311
_no_color = os.environ.get("NO_COLOR") is not None
1412
_is_tty = sys.stderr.isatty() and not _no_color
@@ -24,19 +22,20 @@ def get_gcloud_token():
2422
gcloud = shutil.which("gcloud")
2523
if not gcloud:
2624
for candidate in [
27-
Path.home() / "Downloads/google-cloud-sdk/bin/gcloud",
28-
Path("/usr/lib/google-cloud-sdk/bin/gcloud"),
29-
Path("/opt/homebrew/bin/gcloud"),
25+
os.path.expanduser("~/Downloads/google-cloud-sdk/bin/gcloud"),
26+
"/usr/lib/google-cloud-sdk/bin/gcloud",
27+
"/opt/homebrew/bin/gcloud",
3028
]:
31-
if candidate.exists():
32-
gcloud = str(candidate)
29+
if os.path.exists(candidate):
30+
gcloud = candidate
3331
break
3432
if not gcloud:
3533
return None, "gcloud not found in PATH"
3634

3735
result = subprocess.run(
3836
[gcloud, "auth", "print-access-token"],
39-
capture_output=True, text=True
37+
capture_output=True,
38+
text=True,
4039
)
4140
token = result.stdout.strip()
4241
if token:

skills/rhdh-test-plan-review/scripts/fetch_schedule.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,14 @@ def get_gcloud_token():
5858
if not gcloud:
5959
return None
6060

61-
result = subprocess.run(
62-
[gcloud, "auth", "print-access-token"],
63-
capture_output=True, text=True
64-
)
61+
result = subprocess.run([gcloud, "auth", "print-access-token"], capture_output=True, text=True)
6562
token = result.stdout.strip()
6663
return token if token else None
6764

6865

6966
def get_sheets_service():
70-
from googleapiclient.discovery import build
7167
from google.oauth2.credentials import Credentials
68+
from googleapiclient.discovery import build
7269

7370
token = get_gcloud_token()
7471
if not token:
@@ -220,21 +217,19 @@ def main():
220217
error_exit("no_schedule_tab_found", {"tabs": tabs})
221218

222219
log(f"Reading tab: {tab}")
223-
result = (
224-
service.spreadsheets()
225-
.values()
226-
.get(spreadsheetId=SPREADSHEET_ID, range=tab)
227-
.execute()
228-
)
220+
result = service.spreadsheets().values().get(spreadsheetId=SPREADSHEET_ID, range=tab).execute()
229221
rows = result.get("values", [])
230222

231223
milestones = find_milestones(rows, version)
232224

233225
if not milestones.get("code_freeze") and not milestones.get("ga_date"):
234226
error_exit(
235227
"version_not_found",
236-
{"version": version, "tab": tab,
237-
"hint": "Check that the version string matches the sheet exactly"},
228+
{
229+
"version": version,
230+
"tab": tab,
231+
"hint": "Check that the version string matches the sheet exactly",
232+
},
238233
)
239234

240235
output = {

0 commit comments

Comments
 (0)