Add plugin_lines_skipped option (#249)
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
return null
|
return null
|
||||||
|
|
||||||
//Load inputs
|
//Load inputs
|
||||||
imports.metadata.plugins.lines.inputs({data, account, q})
|
let {skipped} = imports.metadata.plugins.lines.inputs({data, account, q})
|
||||||
|
|
||||||
//Context
|
//Context
|
||||||
let context = {mode:"user"}
|
let context = {mode:"user"}
|
||||||
@@ -22,8 +22,7 @@
|
|||||||
//Get contributors stats from repositories
|
//Get contributors stats from repositories
|
||||||
console.debug(`metrics/compute/${login}/plugins > lines > querying api`)
|
console.debug(`metrics/compute/${login}/plugins > lines > querying api`)
|
||||||
const lines = {added:0, deleted:0}
|
const lines = {added:0, deleted:0}
|
||||||
const response = await Promise.all(repositories.map(({repo, owner}) => rest.repos.getContributorsStats({owner, repo})))
|
const response = await Promise.all(repositories.map(({repo, owner}) => (skipped.includes(repo.toLocaleLowerCase()))||(skipped.includes(`${owner}/${repo}`)) ? {} : rest.repos.getContributorsStats({owner, repo})))
|
||||||
|
|
||||||
//Compute changed lines
|
//Compute changed lines
|
||||||
console.debug(`metrics/compute/${login}/plugins > lines > computing total diff`)
|
console.debug(`metrics/compute/${login}/plugins > lines > computing total diff`)
|
||||||
response.map(({data:repository}) => {
|
response.map(({data:repository}) => {
|
||||||
|
|||||||
@@ -13,3 +13,11 @@ inputs:
|
|||||||
description: Display lines of code metrics
|
description: Display lines of code metrics
|
||||||
type: boolean
|
type: boolean
|
||||||
default: no
|
default: no
|
||||||
|
|
||||||
|
# List of repositories that will be skipped
|
||||||
|
plugin_lines_skipped:
|
||||||
|
description: Repositories to skip
|
||||||
|
type: array
|
||||||
|
format: comma-separated
|
||||||
|
default: ""
|
||||||
|
example: my-repo-1, my-repo-2, owner/repo-3 ...
|
||||||
Reference in New Issue
Block a user