From 8e394bf76d3d52f918450678fb264c069ad0a8a1 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 17 Jun 2021 23:03:53 +0200 Subject: [PATCH] Apply linter --- source/app/metrics/utils.mjs | 4 ++-- source/plugins/languages/analyzers.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index 4dc4aefc..1a6d25fe 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -163,7 +163,7 @@ export async function run(command, options, {prefixed = true, log = true} = {}) } /**Spawn command (use this to execute commands and process output on the fly) */ -export async function spawn(command, args = [], options = {}, {prefixed = true, timeout = 300*1000, stdout} = {}) { +export async function spawn(command, args = [], options = {}, {prefixed = true, timeout = 300*1000, stdout} = {}) { //eslint-disable-line max-params const prefix = {win32:"wsl"}[process.platform] ?? "" if ((prefixed)&&(prefix)) { args.unshift(command) @@ -181,7 +181,7 @@ export async function spawn(command, args = [], options = {}, {prefixed = true, console.debug(`metrics/command/spawn > ${command} with ${args.join(" ")} > exited with code ${code}`) await closed console.debug(`metrics/command/spawn > ${command} with ${args.join(" ")} > reader closed`) - return code === 0 ? solve(stdout) : reject(stderr) + return code === 0 ? solve() : reject() }) }) } diff --git a/source/plugins/languages/analyzers.mjs b/source/plugins/languages/analyzers.mjs index 962402d2..0ca5e8a5 100644 --- a/source/plugins/languages/analyzers.mjs +++ b/source/plugins/languages/analyzers.mjs @@ -152,7 +152,7 @@ async function analyze({login, imports, data}, {results, path}) { for (let page = 0; ; page++) { try { console.debug(`metrics/compute/${login}/plugins > languages > indepth > processing commits ${page*per_page} from ${(page+1)*per_page}`) - let file = null, lang = null, empty = true + let empty = true, file = null, lang = null await imports.spawn("git", ["log", ...data.shared["commits.authoring"].map(authoring => `--author="${authoring}"`), "--regexp-ignore-case", "--format=short", "--patch", `--max-count=${per_page}`, `--skip=${page*per_page}`], {cwd:path}, { stdout(line) { //Unflag empty output