1 | coffeelint = require 'gulp-coffeelint'
|
2 | runSequence = require 'run-sequence'
|
3 |
|
4 | module.exports = (gulp) ->
|
5 | aTaskHasErrors = false
|
6 |
|
7 | gulp.task 'lint', (callback) ->
|
8 | runSequence 'lint:coffee', ->
|
9 | if aTaskHasErrors
|
10 | process.exit 1
|
11 | callback()
|
12 |
|
13 |
|
14 | gulp.task 'lint:coffee', ->
|
15 |
|
16 | class CoffeelintReporter
|
17 | constructor: (@errorReport) ->
|
18 |
|
19 | publish: ->
|
20 | if @errorReport.hasError()
|
21 | aTaskHasErrors = true
|
22 |
|
23 | gulp.src [
|
24 | 'src/**/*.coffee'
|
25 | 'gulp/**/*.coffee'
|
26 | ]
|
27 | .pipe coffeelint()
|
28 | .pipe(coffeelint.reporter())
|
29 | .pipe(coffeelint.reporter CoffeelintReporter)
|