From 4eed10a5e8bb3755bc0ec82100107c3145ab8e7e Mon Sep 17 00:00:00 2001 From: jamesconwaydev <148910373+jamesconwaydev@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:52:34 -0700 Subject: [PATCH] style(site): format the badge endpoints Co-Authored-By: Claude Sonnet 5.5 --- site/src/lib/embeds.ts | 6 +++++- site/src/pages/scorecard.svg.ts | 3 ++- site/tests/badges.test.mjs | 18 +++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/site/src/lib/embeds.ts b/site/src/lib/embeds.ts index 2121fb9..e75b907 100644 --- a/site/src/lib/embeds.ts +++ b/site/src/lib/embeds.ts @@ -86,7 +86,11 @@ export const badge = (live: SiteEntry[]) => ({ }); // shortcut: widths are estimated at 6.6px a character, not measured; fine for short ASCII labels. -export function flatBadge(label: string, message: string, color: string): string { +export function flatBadge( + label: string, + message: string, + color: string, +): string { const lw = Math.round(label.length * 6.6 + 10); const rw = Math.round(message.length * 6.6 + 10); const w = lw + rw; diff --git a/site/src/pages/scorecard.svg.ts b/site/src/pages/scorecard.svg.ts index af1954b..33c309d 100644 --- a/site/src/pages/scorecard.svg.ts +++ b/site/src/pages/scorecard.svg.ts @@ -1,6 +1,7 @@ import { flatBadge } from "../lib/embeds.ts"; -const URL_ = "https://api.scorecard.dev/projects/github.com/devstreamhq/devstream"; +const URL_ = + "https://api.scorecard.dev/projects/github.com/devstreamhq/devstream"; export async function GET() { let msg = "pending"; diff --git a/site/tests/badges.test.mjs b/site/tests/badges.test.mjs index 37ba1e0..e00121c 100644 --- a/site/tests/badges.test.mjs +++ b/site/tests/badges.test.mjs @@ -6,7 +6,9 @@ import { GET as scorecard } from "../src/pages/scorecard.svg.ts"; const realFetch = globalThis.fetch; const mock = (fn) => (globalThis.fetch = fn); -const json = (body, ok = true) => async () => ({ ok, json: async () => body }); +const json = + (body, ok = true) => + async () => ({ ok, json: async () => body }); const text = async (r) => r.text(); const checks = (svg) => { assert.ok(!/