1
0
mirror of https://github.com/badges/shields.git synced 2025-10-22 20:32:32 +03:00

convert some service classes to static props, run [codacy codeclimate codecov] (#5514)

* refactor(codacy): convert to static props

* refactor(codeclimate): convert to static props

* refactor(codecov): convert to static props

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Caleb Cartwright
2020-09-12 11:55:45 -05:00
committed by GitHub
parent 55310c3ed0
commit 005b3ba4ac
5 changed files with 136 additions and 189 deletions

View File

@@ -88,57 +88,50 @@ const variantMap = {
}
module.exports = class CodeclimateAnalysis extends BaseJsonService {
static get category() {
return 'analysis'
static category = 'analysis'
static route = {
base: 'codeclimate',
pattern:
':variant(maintainability|maintainability-percentage|tech-debt|issues)/:user/:repo',
}
static get route() {
return {
base: 'codeclimate',
static examples = [
{
title: 'Code Climate maintainability',
pattern:
':variant(maintainability|maintainability-percentage|tech-debt|issues)/:user/:repo',
}
}
static get examples() {
return [
{
title: 'Code Climate maintainability',
pattern:
':format(maintainability|maintainability-percentage)/:user/:repo',
namedParams: {
format: 'maintainability',
user: 'angular',
repo: 'angular',
},
staticPreview: this.render({
variant: 'maintainability',
maintainabilityLetter: 'F',
}),
keywords,
':format(maintainability|maintainability-percentage)/:user/:repo',
namedParams: {
format: 'maintainability',
user: 'angular',
repo: 'angular',
},
{
title: 'Code Climate issues',
pattern: 'issues/:user/:repo',
namedParams: { user: 'twbs', repo: 'bootstrap' },
staticPreview: this.render({
variant: 'issues',
issueCount: '89',
}),
keywords,
},
{
title: 'Code Climate technical debt',
pattern: 'tech-debt/:user/:repo',
namedParams: { user: 'angular', repo: 'angular' },
staticPreview: this.render({
variant: 'tech-debt',
techDebtPercentage: 3.0,
}),
keywords,
},
]
}
staticPreview: this.render({
variant: 'maintainability',
maintainabilityLetter: 'F',
}),
keywords,
},
{
title: 'Code Climate issues',
pattern: 'issues/:user/:repo',
namedParams: { user: 'twbs', repo: 'bootstrap' },
staticPreview: this.render({
variant: 'issues',
issueCount: '89',
}),
keywords,
},
{
title: 'Code Climate technical debt',
pattern: 'tech-debt/:user/:repo',
namedParams: { user: 'angular', repo: 'angular' },
staticPreview: this.render({
variant: 'tech-debt',
techDebtPercentage: 3.0,
}),
keywords,
},
]
static render({ variant, ...props }) {
const { render } = variantMap[variant]