Skip to content

Commit c4cf454

Browse files
committed
refactor: remove implicit multiline string concatenation
1 parent 53f16ab commit c4cf454

9 files changed

Lines changed: 138 additions & 148 deletions

File tree

dashboard_action/runtime/scripts/collect.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def __init__(
8080
self.retry_at_utc = retry_at_utc
8181
self.retry_source = source
8282
message = (
83-
"GitHub secondary rate limit encountered for "
84-
f"{url}. Do not retry until after "
85-
f"{retry_at_utc.strftime('%Y-%m-%d %H:%M:%S UTC')} "
83+
"GitHub secondary rate limit encountered for " +
84+
f"{url}. Do not retry until after " +
85+
f"{retry_at_utc.strftime('%Y-%m-%d %H:%M:%S UTC')} " +
8686
f"({retry_after_seconds}s, source: {source})."
8787
)
8888
super().__init__(message, response=response)
@@ -101,8 +101,8 @@ def __init__(
101101
self.response = response
102102
self.attempts = attempts
103103
message = (
104-
"Repository traffic endpoint remained unavailable after "
105-
f"{attempts} attempt(s): {url}. The repo may have been deleted, "
104+
"Repository traffic endpoint remained unavailable after " +
105+
f"{attempts} attempt(s): {url}. The repo may have been deleted, " +
106106
"renamed, transferred, or may no longer be accessible."
107107
)
108108
super().__init__(message, response=response)
@@ -177,8 +177,8 @@ def _write_step_summary(
177177
])
178178
for warning in _NETWORK_WARNINGS:
179179
lines.append(
180-
"- Attempt "
181-
f"{warning['attempt']} for `{warning['url']}` failed with "
180+
"- Attempt " +
181+
f"{warning['attempt']} for `{warning['url']}` failed with " +
182182
f"`{warning['error_type']}`: {warning['message']}"
183183
)
184184

@@ -368,7 +368,7 @@ def fetch_json(
368368
if attempt < MAX_RETRIES:
369369
wait = _retry_delay_with_jitter(attempt)
370370
print(
371-
f" Retry {attempt}/{MAX_RETRIES} after network error: {exc} "
371+
f" Retry {attempt}/{MAX_RETRIES} after network error: {exc} " +
372372
f"(sleeping {wait:.2f}s)"
373373
)
374374
time.sleep(wait)
@@ -433,8 +433,8 @@ def discover_repositories(headers: Headers) -> list[RepoMetadata]:
433433
discovered = []
434434
while True:
435435
url = (
436-
f"{REPO_DISCOVERY_URL}?affiliation=owner,collaborator,organization_member"
437-
f"&sort=updated&direction=desc&per_page={REPO_DISCOVERY_PAGE_SIZE}"
436+
f"{REPO_DISCOVERY_URL}?affiliation=owner,collaborator,organization_member" +
437+
f"&sort=updated&direction=desc&per_page={REPO_DISCOVERY_PAGE_SIZE}" +
438438
f"&page={page}"
439439
)
440440
page_rows = fetch_json(url, headers)
@@ -574,8 +574,8 @@ def resolve_repositories(
574574
print("Error: no eligible repositories remain in 'include_only'.")
575575
sys.exit(1)
576576
print(
577-
"Repository discovery: "
578-
f"{len(discovered)} accessible, {len(eligible)} eligible after filters, "
577+
"Repository discovery: " +
578+
f"{len(discovered)} accessible, {len(eligible)} eligible after filters, " +
579579
f"tracking {len(resolved)} from include_only."
580580
)
581581
return resolved, manifest, {
@@ -626,9 +626,9 @@ def resolve_repositories(
626626
state["auto_cutoff_created_at"] = ""
627627

628628
print(
629-
"Repository discovery: "
630-
f"{len(discovered)} accessible, {len(eligible)} eligible after filters, "
631-
f"tracking {len(resolved)} "
629+
"Repository discovery: " +
630+
f"{len(discovered)} accessible, {len(eligible)} eligible after filters, " +
631+
f"tracking {len(resolved)} " +
632632
f"({explicit_count} explicit, {auto_count} automatic)."
633633
)
634634

@@ -785,7 +785,7 @@ def collect_repo_metrics(
785785

786786
def _fallback_repo_detail_warning(repo: str, exc: Exception) -> str:
787787
return (
788-
f"{repo}: repository detail request failed ({exc}); "
788+
f"{repo}: repository detail request failed ({exc}); " +
789789
"traffic collection continued and repo metrics used discovery fallback."
790790
)
791791

@@ -847,7 +847,7 @@ def main() -> None:
847847
)
848848

849849
print(
850-
f" OK: {len(vc_rows)} day(s), {len(ref_rows)} referrer(s), "
850+
f" OK: {len(vc_rows)} day(s), {len(ref_rows)} referrer(s), " +
851851
f"{len(path_rows)} path(s), {len(metric_rows)} repo metric row(s)"
852852
)
853853
except SecondaryRateLimitError as exc:

dashboard_action/runtime/scripts/load_data.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,8 @@ def _growth_insight_candidates(daily_rows, metric_rows=None, growth=None):
797797
visitors=visitors,
798798
downstream_delta=downstream,
799799
text=(
800-
f"`{repo}` drew {views:,} views and {visitors:,} visitors "
801-
f"without downstream growth in the selected window."
800+
f"`{repo}` drew {views:,} views and {visitors:,} visitors " +
801+
"without downstream growth in the selected window."
802802
),
803803
)
804804

@@ -813,7 +813,7 @@ def _growth_insight_candidates(daily_rows, metric_rows=None, growth=None):
813813
traffic=views,
814814
downstream_delta=downstream,
815815
text=(
816-
f"`{repo}` added {downstream:+,} downstream signals on only "
816+
f"`{repo}` added {downstream:+,} downstream signals on only " +
817817
f"{views:,} views."
818818
),
819819
)
@@ -831,7 +831,7 @@ def _growth_insight_candidates(daily_rows, metric_rows=None, growth=None):
831831
clones=clones,
832832
stargazers_delta=star_delta,
833833
text=(
834-
f"`{repo}` is clone-heavy but star-light "
834+
f"`{repo}` is clone-heavy but star-light " +
835835
f"({clones:,} clones, {star_delta:+,} stars)."
836836
),
837837
)
@@ -872,8 +872,8 @@ def _growth_insight_candidates(daily_rows, metric_rows=None, growth=None):
872872
delta=subscriber_delta,
873873
denominator=denom,
874874
text=(
875-
f"`{repo}` watchers rose {subscriber_delta:+,} "
876-
f"in the selected window."
875+
f"`{repo}` watchers rose {subscriber_delta:+,} " +
876+
"in the selected window."
877877
),
878878
)
879879

@@ -888,8 +888,8 @@ def _growth_insight_candidates(daily_rows, metric_rows=None, growth=None):
888888
traffic=views,
889889
downstream_delta=downstream,
890890
text=(
891-
f"`{repo}` had a traffic spike shape ({views:,} views) "
892-
f"without stars, watchers, or forks moving."
891+
f"`{repo}` had a traffic spike shape ({views:,} views) " +
892+
"without stars, watchers, or forks moving."
893893
),
894894
)
895895

@@ -904,7 +904,7 @@ def _growth_insight_candidates(daily_rows, metric_rows=None, growth=None):
904904
traffic=views,
905905
downstream_delta=downstream,
906906
text=(
907-
f"`{repo}` gained {downstream:+,} downstream signals without "
907+
f"`{repo}` gained {downstream:+,} downstream signals without " +
908908
f"a matching traffic spike ({views:,} views)."
909909
),
910910
)
@@ -971,7 +971,7 @@ def _window_change_candidate(repo, metric, values, min_floor):
971971
"delta": delta,
972972
"pct": pct_value,
973973
"text": (
974-
f"`{repo}` {metric} {pct_text} over the last {window}d "
974+
f"`{repo}` {metric} {pct_text} over the last {window}d " +
975975
f"({prev:,} -> {curr:,}, {delta:+,})."
976976
),
977977
}
@@ -1013,7 +1013,7 @@ def _spike_candidate(repo, metric, values):
10131013
"baseline": median,
10141014
"delta": delta,
10151015
"text": (
1016-
f"`{repo}` {metric} {direction} versus baseline "
1016+
f"`{repo}` {metric} {direction} versus baseline " +
10171017
f"(latest {latest:,} vs trailing median {median:.0f})."
10181018
),
10191019
}

0 commit comments

Comments
 (0)