This commit is contained in:
@@ -154,6 +154,7 @@ async function analyze({login, imports, data}, {results, path, categories = ["pr
|
|||||||
let empty = true, file = null, lang = null
|
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}, {
|
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) {
|
stdout(line) {
|
||||||
|
try {
|
||||||
//Unflag empty output
|
//Unflag empty output
|
||||||
if ((empty)&&(line.trim().length))
|
if ((empty)&&(line.trim().length))
|
||||||
empty = false
|
empty = false
|
||||||
@@ -168,8 +169,8 @@ async function analyze({login, imports, data}, {results, path, categories = ["pr
|
|||||||
//File marker
|
//File marker
|
||||||
if (/^[+]{3}\sb[/](?<file>[\s\S]+)$/.test(line)) {
|
if (/^[+]{3}\sb[/](?<file>[\s\S]+)$/.test(line)) {
|
||||||
file = `${path}/${line.match(/^[+]{3}\sb[/](?<file>[\s\S]+)$/)?.groups?.file}`.replace(/\\/g, "/")
|
file = `${path}/${line.match(/^[+]{3}\sb[/](?<file>[\s\S]+)$/)?.groups?.file}`.replace(/\\/g, "/")
|
||||||
lang = files[file]
|
lang = files[file] ?? null
|
||||||
if (!categories.includes(languageResults[lang].type))
|
if ((lang)&&(!categories.includes(languageResults[lang].type)))
|
||||||
lang = null
|
lang = null
|
||||||
edited.add(file)
|
edited.add(file)
|
||||||
return
|
return
|
||||||
@@ -185,6 +186,10 @@ async function analyze({login, imports, data}, {results, path, categories = ["pr
|
|||||||
results.total += size
|
results.total += size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.debug(`metrics/compute/${login}/plugins > languages > indepth > an error occured while processing line (${error.message}), skipping...`)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
if (empty) {
|
if (empty) {
|
||||||
console.debug(`metrics/compute/${login}/plugins > languages > indepth > no more commits`)
|
console.debug(`metrics/compute/${login}/plugins > languages > indepth > no more commits`)
|
||||||
|
|||||||
Reference in New Issue
Block a user