From 8fe68ad24230fda6e35621745471c221eeb7c66a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Aug 2022 19:23:49 +0000 Subject: [PATCH 1/2] chore: code formatting --- source/app/metrics/index.mjs | 6 +++--- source/app/metrics/metadata.mjs | 4 ++-- source/app/metrics/utils.mjs | 2 +- source/app/web/instance.mjs | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/app/metrics/index.mjs b/source/app/metrics/index.mjs index a66df761..c4aba299 100644 --- a/source/app/metrics/index.mjs +++ b/source/app/metrics/index.mjs @@ -141,10 +141,10 @@ export default async function metrics({login, q}, {graphql, rest, plugins, conf, q = Object.fromEntries([...Object.entries(q).map(([key, value]) => [key.replace(/^plugin_/, "").replace(/_/g, "."), value]), ["base", false]]) //Check users errors const warnings = [] - if ((!Object.keys(Plugins).filter(key => q[key]).length)&&(!parts.length)) - warnings.push({warning:{message:"No plugin were selected"}}) + if ((!Object.keys(Plugins).filter(key => q[key]).length) && (!parts.length)) + warnings.push({warning: {message: "No plugin were selected"}}) const ineffective = Object.keys(q).filter(key => (key.includes(".")) && (key.split(".").at(0) !== "base") && (key.split(".").at(0) in Plugins)).filter(key => !q[key.split(".").at(0)]) - warnings.push(...ineffective.map(key => ({warning:{message:`"${key}" has no effect because "${key.split(".").at(0)}: true" is not set`}}))) + warnings.push(...ineffective.map(key => ({warning: {message: `"${key}" has no effect because "${key.split(".").at(0)}: true" is not set`}}))) //Compute rendering const {rendered} = await metrics({login, q}, {...arguments[1], convert: ["svg", "png", "jpeg"].includes(q["config.output"]) ? q["config.output"] : null, warnings}, arguments[2]) console.debug(`metrics/compute/${login}/embed > ${name} > success >>>>>>>>>>>>>>>>>>>>>>`) diff --git a/source/app/metrics/metadata.mjs b/source/app/metrics/metadata.mjs index bf8815e7..771e7064 100644 --- a/source/app/metrics/metadata.mjs +++ b/source/app/metrics/metadata.mjs @@ -220,9 +220,9 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) { //Enable state handler { meta.enabled = function(enabled, {extras = {}, error = true} = {}) { - if ((process.env.GITHUB_ACTIONS)&&(!enabled)) + if ((process.env.GITHUB_ACTIONS) && (!enabled)) console.warn(`::warning::Plugin "${name}" is currently disabled. Add "plugin_${name}: yes" to your workflow to enable it.`) - if ((error)&&(!enabled)) + if ((error) && (!enabled)) throw Object.assign(new Error(`Plugin "${name}" is disabled${process.env.GITHUB_ACTIONS ? "" : " on this server"}`), {enabled: true}) return (enabled) && (meta.extras("enabled", {extras, error})) } diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index ca5426cd..14f08e30 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -131,7 +131,7 @@ export function formatters({timeZone} = {}) { format.error = function(error, {descriptions = {}, ...attributes} = {}) { try { //Extras features or enable state error - if ((error.extras)||(error.enabled)) + if ((error.extras) || (error.enabled)) throw {error: {message: error.message, instance: error}} //Already formatted error if (error.error?.message) diff --git a/source/app/web/instance.mjs b/source/app/web/instance.mjs index 5d715895..87a975ea 100644 --- a/source/app/web/instance.mjs +++ b/source/app/web/instance.mjs @@ -180,9 +180,9 @@ export default async function({sandbox = false} = {}) { const custom = uapi(session) if (custom) { try { - const {data: {resources}} = await custom.rest.rateLimit.get() - if (resources) - return res.status(200).json({rest: resources.core, graphql: resources.graphql, search: resources.search, login: custom.login}) + const {data: {resources}} = await custom.rest.rateLimit.get() + if (resources) + return res.status(200).json({rest: resources.core, graphql: resources.graphql, search: resources.search, login: custom.login}) } catch (error) { if (error.status === 401) { From be907864e3f88692b2f4eb1a6d3e287f1f721a93 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Aug 2022 19:25:03 +0000 Subject: [PATCH 2/2] ci: auto-regenerate files --- README.md | 4 +++- action.yml | 12 ++++++++++++ source/plugins/community/README.md | 2 +- source/plugins/habits/README.md | 12 ++++++++++++ source/plugins/notable/README.md | 11 +++++++++++ source/plugins/repositories/README.md | 11 +++++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89b9ea4d..fe20da28 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Generate metrics that can be embedded everywhere, including your GitHub profile
plugin_habits_skippedSkipped repositories
+repositories_skippedmaster/mainarray
+(comma-separated)
+plugin_habits_daysplugin_notable_selfInclude own repositories
+master/mainboolean
+plugin_repositories_forksInclude repositories forks
+master/mainboolean
+plugin_repositories_affiliations