Skip to content

Commit 7870932

Browse files
chore: code formatting
1 parent 522b7e7 commit 7870932

File tree

16 files changed

+47
-32
lines changed

16 files changed

+47
-32
lines changed

source/app/action/index.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function quit(reason) {
455455
info("Previous hash", previous)
456456
const current = await svg.hash(rendered)
457457
info("Current hash", current)
458-
const changed = (previous !== current)
458+
const changed = previous !== current
459459
info("Content changed", changed)
460460
if (!changed)
461461
committer.commit = false
@@ -632,7 +632,8 @@ function quit(reason) {
632632
info(`Branch ${committer.head}`, "(deleted)")
633633
}, {retries: retries_output_action, delay: retries_delay_output_action})
634634
break
635-
} while (--attempts)
635+
}
636+
while (--attempts)
636637
}
637638
}
638639

source/app/metrics/utils.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export const svg = {
524524
const padding = {width: 1, height: 1, absolute: {width: 0, height: 0}}
525525
paddings = Array.isArray(paddings) ? paddings : `${paddings}`.split(",").map(x => x.trim())
526526
for (const [i, dimension] of [[0, "width"], [1, "height"]]) {
527-
let operands = (paddings?.[i] ?? paddings[0])
527+
let operands = paddings?.[i] ?? paddings[0]
528528
let {relative} = operands.match(/(?<relative>[+-]?[\d.]+)%$/)?.groups ?? {}
529529
operands = operands.replace(relative, "").trim()
530530
let {absolute} = operands.match(/^(?<absolute>[+-]?[\d.]+)/)?.groups ?? {}

source/app/web/statics/insights/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@
138138
console.warn(`${plugin}: no data yet, retrying in ${interval} seconds`)
139139
await new Promise(solve => setTimeout(solve, interval * 1000))
140140
}
141-
} while (--attempts)
141+
}
142+
while (--attempts)
142143
completed++
143144
this.progress = completed / (data.plugins.length + 1)
144145
this.loaded.push(plugin)

source/plugins/anilist/index.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export default async function({login, data, queries, imports, q, account}, {enab
7474
if (await retry({login, imports, error}))
7575
continue
7676
}
77-
} while (next)
77+
}
78+
while (next)
7879
//Format and save results
7980
result.lists[type].favorites = shuffle ? imports.shuffle(list) : list
8081
//Limit results
@@ -107,7 +108,8 @@ export default async function({login, data, queries, imports, q, account}, {enab
107108
if (await retry({login, imports, error}))
108109
continue
109110
}
110-
} while (next)
111+
}
112+
while (next)
111113
//Format and save results
112114
result.characters = shuffle ? imports.shuffle(characters) : characters
113115
//Limit results

source/plugins/base/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ export default async function({login, graphql, rest, data, q, queries, imports,
173173
console.debug(`metrics/compute/${login}/base > retrieved less repositories than expected, probably no more to fetch`)
174174
break
175175
}
176-
} while ((pushed) && (cursor) && ((data.user.repositories?.nodes?.length ?? 0) + (data.user.repositoriesContributedTo?.nodes?.length ?? 0) < repositories))
176+
}
177+
while ((pushed) && (cursor) && ((data.user.repositories?.nodes?.length ?? 0) + (data.user.repositoriesContributedTo?.nodes?.length ?? 0) < repositories))
177178
//Limit repositories
178179
console.debug(`metrics/compute/${login}/base > keeping only ${repositories} ${type}`)
179180
data.user[type].nodes.splice(repositories)

source/plugins/community/nightscout/index.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export default async function({q, imports, data, account}, {enabled = false, ext
2828
resp.data[i].arrowHumanReadable = directionArrow(resp.data[i].direction)
2929
resp.data[i].timeUTCHumanReadable = `${addZero(date.getUTCHours())}:${addZero(date.getUTCMinutes())}`
3030
/*
31-
* Add colors and alert names
32-
* TODO: Maybe make colors better themed instead of just the "github style" - red and yellow could fit better than darker shades of green
33-
*/
31+
* Add colors and alert names
32+
* TODO: Maybe make colors better themed instead of just the "github style" - red and yellow could fit better than darker shades of green
33+
*/
3434
let color = "#40c463"
3535
let alertName = "Normal"
3636
if (sgv >= urgenthighalert || sgv <= urgentlowalert) {

source/plugins/discussions/index.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default async function({login, q, imports, graphql, queries, data, accoun
2828
fetched.push(...nodes)
2929
pushed = nodes.length
3030
console.debug(`metrics/compute/${login}/discussions > retrieved ${pushed} discussions after ${cursor}`)
31-
} while ((pushed) && (cursor))
31+
}
32+
while ((pushed) && (cursor))
3233

3334
//Compute upvotes
3435
fetched.map(({upvoteCount}) => discussions.upvotes.discussions += upvoteCount)
@@ -53,7 +54,8 @@ export default async function({login, q, imports, graphql, queries, data, accoun
5354
fetched.push(...nodes)
5455
pushed = nodes.length
5556
console.debug(`metrics/compute/${login}/discussions > retrieved ${pushed} comments after ${cursor}`)
56-
} while ((pushed) && (cursor))
57+
}
58+
while ((pushed) && (cursor))
5759

5860
//Compute upvotes
5961
fetched.map(({upvoteCount}) => discussions.upvotes.comments += upvoteCount)

source/plugins/gists/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export default async function({login, data, graphql, q, imports, queries, accoun
2222
gists.push(...nodes)
2323
gists.totalCount = totalCount
2424
pushed = nodes.length
25-
} while ((pushed) && (cursor))
25+
}
26+
while ((pushed) && (cursor))
2627
console.debug(`metrics/compute/${login}/plugins > gists > loaded ${gists.length} gists`)
2728
}
2829

source/plugins/notable/index.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export default async function({login, q, imports, rest, graphql, data, account,
2525
.filter(({node}) => imports.filters.github(filter, {name: node.nameWithOwner, user: node.owner.login, stars: node.stargazers.totalCount, watchers: node.watchers.totalCount, forks: node.forks.totalCount}))
2626
.map(({node}) => contributions.push({handle: node.nameWithOwner, stars: node.stargazers.totalCount, issues: node.issues.totalCount, pulls: node.pullRequests.totalCount, organization: node.isInOrganization, avatarUrl: node.owner.avatarUrl}))
2727
pushed = edges.length
28-
} while ((pushed) && (cursor))
28+
}
29+
while ((pushed) && (cursor))
2930
}
3031

3132
//Set contributions
@@ -47,7 +48,8 @@ export default async function({login, q, imports, rest, graphql, data, account,
4748
cursor = edges?.[edges?.length - 1]?.cursor
4849
edges.map(({node: {repository: {nameWithOwner: repository}}}) => issues[repository] = (issues[repositories] ?? 0) + 1)
4950
pushed = edges.length
50-
} while ((pushed) && (cursor))
51+
}
52+
while ((pushed) && (cursor))
5153
}
5254

5355
//Fetch pull requests
@@ -61,7 +63,8 @@ export default async function({login, q, imports, rest, graphql, data, account,
6163
cursor = edges?.[edges?.length - 1]?.cursor
6264
edges.map(({node: {repository: {nameWithOwner: repository}}}) => pulls[repository] = (pulls[repositories] ?? 0) + 1)
6365
pushed = edges.length
64-
} while ((pushed) && (cursor))
66+
}
67+
while ((pushed) && (cursor))
6568
}
6669

6770
//Fetch commits

source/plugins/people/index.mjs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,16 @@ export default async function({login, data, graphql, rest, q, queries, imports,
5252
let pushed = 0
5353
do {
5454
console.debug(`metrics/compute/${login}/plugins > people > retrieving ${type} after ${cursor}`)
55-
const {[type]: {edges}} = (
56-
type in context.sponsorships
57-
? (await graphql(queries.people.sponsors({login: context.owner ?? login, type, size, after: cursor ? `after: "${cursor}"` : "", target: context.sponsorships[type], account})))[account]
58-
: context.mode === "repository"
59-
? (await graphql(queries.people.repository({login: context.owner, repository: context.repo, type, size, after: cursor ? `after: "${cursor}"` : "", account})))[account].repository
60-
: (await graphql(queries.people({login, type, size, after: cursor ? `after: "${cursor}"` : "", account})))[account]
61-
)
55+
const {[type]: {edges}} = type in context.sponsorships
56+
? (await graphql(queries.people.sponsors({login: context.owner ?? login, type, size, after: cursor ? `after: "${cursor}"` : "", target: context.sponsorships[type], account})))[account]
57+
: context.mode === "repository"
58+
? (await graphql(queries.people.repository({login: context.owner, repository: context.repo, type, size, after: cursor ? `after: "${cursor}"` : "", account})))[account].repository
59+
: (await graphql(queries.people({login, type, size, after: cursor ? `after: "${cursor}"` : "", account})))[account]
6260
cursor = edges?.[edges?.length - 1]?.cursor
6361
result[type].push(...edges.map(({node}) => node[context.sponsorships[type]] ?? node))
6462
pushed = edges.length
65-
} while ((pushed) && (cursor) && ((limit === 0) || (result[type].length <= (shuffle ? 10 * limit : limit))))
63+
}
64+
while ((pushed) && (cursor) && ((limit === 0) || (result[type].length <= (shuffle ? 10 * limit : limit))))
6665
}
6766
//Shuffle
6867
if (shuffle) {

0 commit comments

Comments
 (0)