Code Monkey home page Code Monkey logo

gulp-checkstyle-jenkins-reporter's Introduction

Information

Packagegulp-checkstyle-jenkins-reporter
Description Advanced reporter for gulp-jshint and gulp-jscs to be used by Jenkins (Hudson). Writes output to an xml file.
Node Version >= 0.3

Install

npm install gulp-checkstyle-jenkins-reporter --save-dev

Usage

var gulp = require('gulp');
var jshint = require('gulp-jshint');

gulp.task('lint', function() {
  return gulp.src('./lib/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('gulp-checkstyle-jenkins-reporter'));
});

This will output the report to checkstyle-result.xml

Advances usage

var gulp = require('gulp');
var jshint = require('gulp-jshint');

gulp.task('lint', function() {
  return gulp.src('./lib/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('gulp-checkstyle-jenkins-reporter', {
      filename: __reports + '/jshint-checkstyle.xml',
	  level: 'e', 
	  base:'src/', 
	  sourceDir:'path/to/repo/'
    }));
});

Options

Plugin options:

Type: filename Default: "checkstyle-result.xml"

The filename to write output from jshint. When linting is successfull, the file is not created.

Type: level Default: "ewi"

The level of severity you want the report to catch. e: error, w: warning, i: info. can be any combination of the three letters.

Type: base Default: ""

If given, the path of the files will be rebased according to the value. For instance: if your file path is C:/git/src/myApp/js/somejsfile.js and you set base with src/ then the xml will contain the following path : myApp/js/somejsfile.js For Windows backslash are used.

Type: sourceDir Default: ""

If given, the path of the files will be prefixed with the sourceDir. For instance: if your file path is C:/git/src/myApp/js/somejsfile.js and you set base with src/ and set sourceDir with someplace/else/ then the xml will contain the following path : someplace/else/myApp/js/somejsfile.js For Windows backslash are used.

Using it with JSCS

You can also obtain reports for JSCS. For this you will need an extra plugin: gulp-jscs-stylish.

npm install gulp-jscs-stylish --save-dev
var gulp = require('gulp');
var jshint = require('gulp-jshint');

gulp.task('lint', function() {
  return gulp.src('./lib/*.js')
    .pipe(jshint())    // optional if you want jshint to be runned
    .pipe($.jscs())
    .on('error', function(){})
	.pipe($.jscsStylish.combineWithHintResults())
    .pipe(jshint.reporter('gulp-checkstyle-jenkins-reporter'));
});

You will notice that errors from jscs and jshint are marked differently in the checkfile, so you know which error came from where.

LICENSE

The MIT License (MIT)

Copyright (c) 2014 Igor DeFaye

gulp-checkstyle-jenkins-reporter's People

Contributors

cl1ck avatar idefy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.