From a6932e9d4a1f085c8fc9724dc68c9a8bb18bd1e1 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Tue, 15 Feb 2022 21:02:12 -0500 Subject: [PATCH] fix: apply @Nixinova's code review --- source/app/metrics/utils.mjs | 4 ++-- source/plugins/code/metadata.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index f7ad3a6e..a7612a31 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -173,8 +173,8 @@ export async function chartist() { /**Language analyzer (single file) */ export async function language({filename, patch}) { console.debug(`metrics/language > ${filename}`) - const {languages:{results}} = await linguist(filename, {fileContent:patch}) - const result = (Object.keys(results).shift() ?? "unknown").toLocaleLowerCase() + const {files:{results}} = await linguist(filename, {fileContent:patch}) + const result = (results[filename] ?? "unknown").toLocaleLowerCase() console.debug(`metrics/language > ${filename} > result: ${result}`) return result } diff --git a/source/plugins/code/metadata.yml b/source/plugins/code/metadata.yml index 730f011b..ecabadd5 100644 --- a/source/plugins/code/metadata.yml +++ b/source/plugins/code/metadata.yml @@ -33,7 +33,7 @@ inputs: min: 100 max: 1000 - plugin_activity_days: + plugin_code_days: description: Events maximum age type: number default: 3