Fix habits and stargazers plugin, add repositories_affiliations options and metadata updates (#117)

This commit is contained in:
Simon Lecoq
2021-02-08 20:35:39 +01:00
committed by GitHub
parent cd83e85146
commit 3f0b9f96a6
31 changed files with 471 additions and 490 deletions

View File

@@ -100,7 +100,7 @@
console.debug(`metrics/compute/${login}/plugins > habits > running linguist`)
;(await imports.run(`${prefix} github-linguist --breakdown`, {cwd:path}))
//Parse linguist result
.split("\n").map(line => line.match(/(?<value>[\d.]+)%\s+(?<language>\w+)/)?.groups).filter(line => line)
.split("\n").map(line => line.match(/(?<value>[\d.]+)%\s+(?<language>[\s\S]+)$/)?.groups).filter(line => line)
.map(({value, language}) => habits.linguist.languages[language] = (habits.linguist.languages[language] ?? 0) + value/100)
habits.linguist.ordered = Object.entries(habits.linguist.languages).sort(([_an, a], [_bn, b]) => b - a)
}

View File

@@ -1,5 +1,6 @@
name: "💡 Coding habits"
cost: 1 REST request per 100 events + 1 REST request pet commit
categorie: github
supports:
- user
- organization