Skip to content

Commit 947d455

Browse files
chore: code formatting
1 parent 33a2f43 commit 947d455

File tree

18 files changed

+44
-35
lines changed

18 files changed

+44
-35
lines changed

.github/scripts/preview.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ for (const insights of ["insights", "about"]) {
104104
if (file !== ".statics")
105105
fs.copyFile(paths.join(__web_insights, file), paths.join(__preview_insights, file))
106106
}
107-
}
107+
}

source/app/metrics/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
3838
}
3939
: null),
4040
}
41-
const extras = {css: imports.metadata.plugins.core.extras("extras_css", {...conf.settings, error:false}) ? q["extras.css"] ?? "" : "", js: imports.metadata.plugins.core.extras("extras_js", {...conf.settings, error:false}) ? q["extras.js"] ?? "" : ""}
41+
const extras = {css: imports.metadata.plugins.core.extras("extras_css", {...conf.settings, error: false}) ? q["extras.css"] ?? "" : "", js: imports.metadata.plugins.core.extras("extras_js", {...conf.settings, error: false}) ? q["extras.js"] ?? "" : ""}
4242
const data = {q, animated: true, large: false, base: {}, config: {}, errors: [], plugins: {}, computed: {}, extras, postscripts: []}
4343
const experimental = new Set(decodeURIComponent(q["experimental.features"] ?? "").split(" ").map(x => x.trim().toLocaleLowerCase()).filter(x => x))
4444
if (conf.settings["debug.headless"])
@@ -184,7 +184,7 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf,
184184
if ((conf.settings?.optimize === true) || (conf.settings?.optimize?.includes?.("svg")))
185185
rendered = await imports.svg.optimize.svg(rendered, q, experimental)
186186
//Verify svg
187-
if ((verify)&&(imports.metadata.plugins.core.extras("verify", {...conf.settings, error:false}))) {
187+
if ((verify) && (imports.metadata.plugins.core.extras("verify", {...conf.settings, error: false}))) {
188188
console.debug(`metrics/compute/${login} > verify SVG`)
189189
let libxmljs = null
190190
try {

source/app/metrics/metadata.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) {
265265
console.debug(`metrics/extras > ${name} > ${key} > skipping (no error mode)`)
266266
return false
267267
}
268-
throw Object.assign(new Error(`Unsupported option "${key}"`), {extras:true})
268+
throw Object.assign(new Error(`Unsupported option "${key}"`), {extras: true})
269269
}
270270
}
271271
}

source/app/metrics/setup.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default async function({log = true, sandbox = false, community = {}} = {}
7878
logger("metrics/setup > load package.json > success")
7979

8080
//Load community templates
81-
if ((conf.settings.extras?.features?.includes("metrics.setup.community.templates"))||(conf.settings.extras?.features === true)||(conf.settings.extras?.default)) {
81+
if ((conf.settings.extras?.features?.includes("metrics.setup.community.templates")) || (conf.settings.extras?.features === true) || (conf.settings.extras?.default)) {
8282
if ((typeof conf.settings.community.templates === "string") && (conf.settings.community.templates.length)) {
8383
logger("metrics/setup > parsing community templates list")
8484
conf.settings.community.templates = [...new Set([...decodeURIComponent(conf.settings.community.templates).split(",").map(v => v.trim().toLocaleLowerCase()).filter(v => v)])]
@@ -194,12 +194,12 @@ export default async function({log = true, sandbox = false, community = {}} = {}
194194
conf.metadata = await metadata({log})
195195

196196
//Modes
197-
if ((!conf.settings.modes)||(!conf.settings.modes.length))
197+
if ((!conf.settings.modes) || (!conf.settings.modes.length))
198198
conf.settings.modes = ["embed", "insights"]
199199
logger(`metrics/setup > setup > enabled modes ${JSON.stringify(conf.settings.modes)}`)
200200

201201
//Allowed outputs formats
202-
if ((!conf.settings.outputs)||(!conf.settings.outputs.length))
202+
if ((!conf.settings.outputs) || (!conf.settings.outputs.length))
203203
conf.settings.outputs = metadata.inputs.config_output.values
204204
else
205205
conf.settings.outputs = conf.settings.outputs.filter(format => metadata.inputs.config_output.values.includes(format))

source/app/metrics/utils.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export function formatters({timeZone} = {}) {
148148
message = `API error: ${status}`
149149

150150
//Error description (optional)
151-
if ((descriptions)&&(descriptions[status]))
151+
if ((descriptions) && (descriptions[status]))
152152
message += ` (${descriptions[status]})`
153153
else {
154154
const description = error.response?.data?.errors?.[0]?.message ?? error.response.data?.error_description ?? error.response?.data?.message ?? null

source/app/web/instance.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export default async function({sandbox = false} = {}) {
338338
//Render
339339
const q = req.query
340340
console.debug(`metrics/app/${login} > ${util.inspect(q, {depth: Infinity, maxStringLength: 256})}`)
341-
if ((q["config.presets"]) && ((conf.settings.extras?.features?.includes("metrics.setup.community.presets"))||(conf.settings.extras?.features === true)||(conf.settings.extras?.default))) {
341+
if ((q["config.presets"]) && ((conf.settings.extras?.features?.includes("metrics.setup.community.presets")) || (conf.settings.extras?.features === true) || (conf.settings.extras?.default))) {
342342
console.debug(`metrics/app/${login} > presets have been specified, loading them`)
343343
Object.assign(q, await presets(q["config.presets"]))
344344
}

source/app/web/statics/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@
6666
},
6767
},
6868
//Methods
69-
methods:{
69+
methods: {
7070
//Metrics insights
7171
async insights() {
7272
window.location.href = `/insights?user=${this.user1}`
7373
},
7474
//Metrics embed
7575
async embed() {
7676
window.location.href = `/embed?user=${this.user2}`
77-
}
78-
}
77+
},
78+
},
7979
})
8080
})()

source/plugins/base/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default async function({login, graphql, rest, data, q, queries, imports,
8989
}
9090
//Query contributions collection over account lifetime instead of last year
9191
if (account === "user") {
92-
if ((indepth) && (imports.metadata.plugins.base.extras("indepth", {...conf.settings, error:false}))) {
92+
if ((indepth) && (imports.metadata.plugins.base.extras("indepth", {...conf.settings, error: false}))) {
9393
const fields = ["totalRepositoriesWithContributedCommits", "totalCommitContributions", "restrictedContributionsCount", "totalIssueContributions", "totalPullRequestContributions", "totalPullRequestReviewContributions"]
9494
const start = new Date(data.user.createdAt)
9595
const end = new Date()

source/plugins/community/screenshot/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ export default async function({login, q, imports, data, account}, {enabled = fal
3737
}
3838
//Handle errors
3939
catch (error) {
40-
throw imports.format.error(error, {title:"Screenshot error"})
40+
throw imports.format.error(error, {title: "Screenshot error"})
4141
}
4242
}

source/plugins/followup/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default async function({login, data, computed, imports, q, graphql, queri
5757
}
5858

5959
//Indepth mode
60-
if ((indepth)&&(imports.metadata.plugins.followup.extras("indepth", {extras}))) {
60+
if ((indepth) && (imports.metadata.plugins.followup.extras("indepth", {extras}))) {
6161
console.debug(`metrics/compute/${login}/plugins > followup > indepth`)
6262
followup.indepth = {repositories: {}}
6363

0 commit comments

Comments
 (0)