bootlint-teamcity
Version:
BootLint TeamCity Reporter which group by files and BootLint Rule using TeamCity Test Suite
64 lines (48 loc) • 2.63 kB
Markdown
bootlint-teamcity
=================
[](https://www.npmjs.com/package/bootlint-teamcity)
[](https://github.com/SiCoe/bootlint-teamcity/blob/master/LICENSE)
[](https://david-dm.org/SiCoe/bootlint-teamcity)
[](https://david-dm.org/SiCoe/bootlint-teamcity?type=dev)
[](https://github.com/SiCoe/bootlint-teamcity/issues)
TeamCity reporter for [bootlint](https://github.com/twbs/bootlint) errors.
## Install
```shell
npm install --save-dev bootlint-teamcity
```
## Usage
Use the [gulp-bootlint](https://www.npmjs.com/package/gulp-bootlint) module
for [gulp](https://www.npmjs.com/package/gulp) to pipe in files to be analysed.
When run in [TeamCity](https://www.jetbrains.com/teamcity/) the errors will
show as failed test results and can therefore fail the build.
`bootlint-teamcity` provides an object with a [`reportFn`](https://github.com/tschortsch/gulp-bootlint#optionsreportfn)
and a [`summaryReportFn`](https://github.com/tschortsch/gulp-bootlint#optionssummaryreportfn) function than can be used for the
[Options](https://github.com/tschortsch/gulp-bootlint#options) object passed to `gulp-bootlint`.
```js
var gulp = require('gulp');
var bootlint = require('gulp-bootlint');
var bootlintTeamcity = require('bootlint-teamcity');
gulp.task('default', function () {
gulp.src(['**/*.html'])
.pipe(bootlint(bootlintTeamcity));
```
If other bootlint options are required, the two `bootlint-teamcity` functions can be set within the options object.
Note: both functions are required
```js
var gulp = require('gulp');
var bootlint = require('gulp-bootlint');
var bootlintTeamcity = require('bootlint-teamcity');
gulp.task('default', function () {
gulp.src(['**/*.html'])
.pipe(bootlint({
stoponerror: true,
stoponwarning: true,
loglevel: 'debug',
disabledIds: ['W009', 'E007'],
issues: fileIssues,
reportFn: bootlintTeamcity.reportFn,
summaryReportFn: bootlintTeamcity.summaryReportFn
}));
```
Errors are grouped by file and then by [bootlint problem id](https://github.com/twbs/bootlint/wiki)
when displayed in TeamCity *Build Log* or *Tests* tab.