fix: apply @Nixinova's code review

This commit is contained in:
lowlighter
2022-02-15 21:02:12 -05:00
parent ae92a64c9e
commit a6932e9d4a
2 changed files with 3 additions and 3 deletions

View File

@@ -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
}

View File

@@ -33,7 +33,7 @@ inputs:
min: 100
max: 1000
plugin_activity_days:
plugin_code_days:
description: Events maximum age
type: number
default: 3