Skip to content

Commit cc68e38

Browse files
committed
style(ci): format the RunsOn guard tests with Biome
1 parent dec62d5 commit cc68e38

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎scripts/__tests__/workflow-docker-hub-login.test.mjs‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,11 @@ export function jobFindings(where, job, ref) {
315315
function runsOnJobs() {
316316
return workflowFiles().flatMap((file) =>
317317
Object.entries(readWorkflow(file)?.jobs ?? {})
318-
.map(([name, job]) => ({ where: `${file} ${name}`, ref: `${file}#${name}`, job }))
318+
.map(([name, job]) => ({
319+
where: `${file} ${name}`,
320+
ref: `${file}#${name}`,
321+
job,
322+
}))
319323
.filter(({ job, ref }) => isRunsOnJob(job, ref)),
320324
)
321325
}
@@ -339,7 +343,9 @@ export function callerFinding(job) {
339343
function callerFindings() {
340344
return workflowFiles().flatMap((file) =>
341345
Object.entries(readWorkflow(file)?.jobs ?? {})
342-
.filter(([, job]) => String(job?.uses ?? '').startsWith('./.github/workflows/'))
346+
.filter(([, job]) =>
347+
String(job?.uses ?? '').startsWith('./.github/workflows/'),
348+
)
343349
.flatMap(([name, job]) => {
344350
const called = job.uses.replace(/^\.\//, '').replace(/@.*$/, '')
345351
const logsIn = Object.entries(readWorkflow(called)?.jobs ?? {}).some(
@@ -427,7 +433,10 @@ describe('Docker Hub login on RunsOn', () => {
427433
expect(
428434
callerFinding({
429435
uses,
430-
secrets: { DOCKER_HUB_USERNAME: USERNAME, DOCKER_HUB_PASSWORD: PASSWORD },
436+
secrets: {
437+
DOCKER_HUB_USERNAME: USERNAME,
438+
DOCKER_HUB_PASSWORD: PASSWORD,
439+
},
431440
}),
432441
).toBeNull()
433442
expect(

‎scripts/__tests__/workflow-runs-on.test.mjs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ const jobs = workflowFiles().flatMap((file) =>
3131
})),
3232
)
3333

34-
const refsWhere = (predicate) =>
35-
jobs.filter(predicate).map(({ ref }) => ref)
34+
const refsWhere = (predicate) => jobs.filter(predicate).map(({ ref }) => ref)
3635

3736
/** A runner chosen when the job starts, so a guard cannot read it. */
3837
function isExpressionRunner(job) {

0 commit comments

Comments
 (0)