chore: code formatting

This commit is contained in:
github-actions[bot]
2022-07-26 00:12:25 +00:00
parent a7c19d3eb9
commit 2359ad9bd7
2 changed files with 27 additions and 23 deletions

View File

@@ -4,6 +4,8 @@ import axios from "axios"
import processes from "child_process"
import crypto from "crypto"
import { minify as csso } from "csso"
import * as d3 from "d3"
import D3node from "d3-node"
import emoji from "emoji-name-map"
import { fileTypeFromBuffer } from "file-type"
import fss from "fs"
@@ -30,8 +32,6 @@ import twemojis from "twemoji-parser"
import url from "url"
import util from "util"
import xmlformat from "xml-formatter"
import * as d3 from "d3"
import D3node from "d3-node"
prism_lang()
//Exports

View File

@@ -23,7 +23,9 @@ export default async function({login, data, imports, rest, q, account}, {enabled
//Get contributors stats from repositories
console.debug(`metrics/compute/${login}/plugins > lines > querying api`)
const repos = {}, weeks = {}
const response = [...await Promise.allSettled(repositories.map(async ({repo, owner}) => (skipped.includes(repo.toLocaleLowerCase())) || (skipped.includes(`${owner}/${repo}`.toLocaleLowerCase())) ? {} : {handle:`${owner}/${repo}`, stats:(await rest.repos.getContributorsStats({owner, repo})).data}))].filter(({status}) => status === "fulfilled").map(({value}) => value)
const response = [...await Promise.allSettled(repositories.map(async ({repo, owner}) => (skipped.includes(repo.toLocaleLowerCase())) || (skipped.includes(`${owner}/${repo}`.toLocaleLowerCase())) ? {} : {handle: `${owner}/${repo}`, stats: (await rest.repos.getContributorsStats({owner, repo})).data}))].filter(({status}) => status === "fulfilled").map((
{value},
) => value)
//Compute changed lines
console.debug(`metrics/compute/${login}/plugins > lines > computing total diff`)
@@ -105,10 +107,12 @@ export default async function({login, data, imports, rest, q, account}, {enabled
for (const {type, sign, fill} of [{type: "added", sign: +1, fill: "rgb(63, 185, 80)"}, {type: "deleted", sign: -1, fill: "rgb(218, 54, 51)"}]) {
svg.append("path")
.datum(weeks.map(({date, ...diff}) => [new Date(date), sign * (diff[type] + diff.changed)]))
.attr("d", d3.area()
.attr(
"d",
d3.area()
.x(d => x(d[0]))
.y0(d => y(d[1]))
.y1(() => y(0))
.y1(() => y(0)),
)
.attr("fill", fill)
}