Add repositories_skipped option (#251)
This commit is contained in:
@@ -36,4 +36,5 @@ These are all enabled by default, but you can explicitely opt out from them.
|
|||||||
repositories: 100 # Query only last 100 repositories
|
repositories: 100 # Query only last 100 repositories
|
||||||
repositories_forks: no # Don't include forks
|
repositories_forks: no # Don't include forks
|
||||||
repositories_affiliations: owner, collaborator # Display only repositories where user is owner or collaborator
|
repositories_affiliations: owner, collaborator # Display only repositories where user is owner or collaborator
|
||||||
|
repositories_skipped: lowlighter/lowlighter # Exclude automatically "lowlighter/lowlighter" repository from plugins allowing a skip list
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
export default async function({login, graphql, data, q, queries, imports}, conf) {
|
export default async function({login, graphql, data, q, queries, imports}, conf) {
|
||||||
//Load inputs
|
//Load inputs
|
||||||
console.debug(`metrics/compute/${login}/base > started`)
|
console.debug(`metrics/compute/${login}/base > started`)
|
||||||
let {repositories, "repositories.forks":_forks, "repositories.affiliations":_affiliations} = imports.metadata.plugins.base.inputs({data, q, account:"bypass"}, {repositories:conf.settings.repositories ?? 100})
|
let {repositories, "repositories.forks":_forks, "repositories.affiliations":_affiliations, "repositories.skipped":_skipped} = imports.metadata.plugins.base.inputs({data, q, account:"bypass"}, {repositories:conf.settings.repositories ?? 100})
|
||||||
const forks = _forks ? "" : ", isFork: false"
|
const forks = _forks ? "" : ", isFork: false"
|
||||||
const affiliations = _affiliations?.length ? `, ownerAffiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]${conf.authenticated === login ? `, affiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]` : ""}` : ""
|
const affiliations = _affiliations?.length ? `, ownerAffiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]${conf.authenticated === login ? `, affiliations: [${_affiliations.map(x => x.toLocaleUpperCase()).join(", ")}]` : ""}` : ""
|
||||||
|
|
||||||
@@ -20,6 +20,10 @@
|
|||||||
for (const part of conf.settings.plugins.base.parts)
|
for (const part of conf.settings.plugins.base.parts)
|
||||||
data.base[part] = `base.${part}` in q ? legacy.converter(q[`base.${part}`]) : defaulted
|
data.base[part] = `base.${part}` in q ? legacy.converter(q[`base.${part}`]) : defaulted
|
||||||
|
|
||||||
|
//Shared options
|
||||||
|
data.shared = {"repositories.skipped":_skipped}
|
||||||
|
console.debug(`metrics/compute/${login}/base > shared options > ${JSON.stringify(data.shared)}`)
|
||||||
|
|
||||||
//Iterate through account types
|
//Iterate through account types
|
||||||
for (const account of ["user", "organization"]) {
|
for (const account of ["user", "organization"]) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ inputs:
|
|||||||
- owner # Use repositories you own
|
- owner # Use repositories you own
|
||||||
- collaborator # Use repositories you have contributed too
|
- collaborator # Use repositories you have contributed too
|
||||||
- organization_member # Use repositories where you're an organization member
|
- organization_member # Use repositories where you're an organization member
|
||||||
|
|
||||||
|
# List of default repositories that will be skipped
|
||||||
|
# Plugins supporting a "skip repositories option" will automatically append repositories listed in this option
|
||||||
|
repositories_skipped:
|
||||||
|
description: Default repositories to skip
|
||||||
|
type: array
|
||||||
|
format: comma-separated
|
||||||
|
default: ""
|
||||||
|
example: my-repo-1, my-repo-2, owner/repo-3 ...
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
//Load inputs
|
//Load inputs
|
||||||
let {ignored, skipped, colors, details, threshold, limit} = imports.metadata.plugins.languages.inputs({data, account, q})
|
let {ignored, skipped, colors, details, threshold, limit} = imports.metadata.plugins.languages.inputs({data, account, q})
|
||||||
threshold = (Number(threshold.replace(/%$/, ""))||0)/100
|
threshold = (Number(threshold.replace(/%$/, ""))||0)/100
|
||||||
|
skipped.push(...data.shared["repositories.skipped"])
|
||||||
if (!limit)
|
if (!limit)
|
||||||
limit = Infinity
|
limit = Infinity
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
//Load inputs
|
//Load inputs
|
||||||
let {skipped} = imports.metadata.plugins.lines.inputs({data, account, q})
|
let {skipped} = imports.metadata.plugins.lines.inputs({data, account, q})
|
||||||
|
skipped.push(...data.shared["repositories.skipped"])
|
||||||
|
|
||||||
//Context
|
//Context
|
||||||
let context = {mode:"user"}
|
let context = {mode:"user"}
|
||||||
|
|||||||
Reference in New Issue
Block a user