<commit_before>gulp = require 'gulp'
coffeelint = require 'gulp-coffeelint'
mocha = require 'gulp-mocha'
istanbul = require 'gulp-istanbul'
biscotto = require 'gulp-biscotto'
coffee = require 'gulp-coffee'
gutil = require 'gulp-util'

srcFiles = ['./src/**/*.coffee']
libFiles = ['./lib/**/*.js']

gulp.task 'lint', ->
  gulp.src srcFiles.concat ['./*.coffee', './spec/**/*.coffee']
    .pipe coffeelint()
    .pipe coffeelint.reporter()
    .pipe coffeelint.reporter('fail')

gulp.task 'test', ['lint', 'build'], (cb) ->
  gulp.src libFiles
    .pipe istanbul()
    .on 'finish', ->
      gulp.src ['./spec/**/*-spec.coffee']
        .pipe mocha({
          reporter: 'spec',
          compilers: 'coffee:coffee-script'
        })
        .on 'error', -> @emit 'end'
        .on 'end', cb

  return

gulp.task 'spec', ['test']

gulp.task 'docs', ->
  biscotto()
    .pipe gulp.dest './docs'

gulp.task 'build', ->
  gulp.src srcFiles
    .pipe coffee({ bare: true }).on('error', gutil.log)
    .pipe gulp.dest 'lib'

gulp.task 'ci', ->
  watcher = gulp.watch srcFiles.concat(['./spec/**/*']), ['test']
  watcher.on 'error', (err) ->
    console.log 'An error has occurred'
    console.dir err

gulp.task 'watch', ->
  watcher = gulp.watch srcFiles, ['build']<commit_msg>Add gulp bail to mocha test<commit_after>gulp = require 'gulp'
coffeelint = require 'gulp-coffeelint'
mocha = require 'gulp-mocha'
istanbul = require 'gulp-istanbul'
biscotto = require 'gulp-biscotto'
coffee = require 'gulp-coffee'
gutil = require 'gulp-util'

srcFiles = ['./src/**/*.coffee']
libFiles = ['./lib/**/*.js']

gulp.task 'lint', ->
  gulp.src srcFiles.concat ['./*.coffee', './spec/**/*.coffee']
    .pipe coffeelint()
    .pipe coffeelint.reporter()
    .pipe coffeelint.reporter('fail')

gulp.task 'test', ['lint', 'build'], (cb) ->
  gulp.src libFiles
    .pipe istanbul()
    .on 'finish', ->
      gulp.src ['./spec/**/*-spec.coffee']
        .pipe mocha({
          reporter: 'spec'
          compilers: 'coffee:coffee-script'
          bail: true
        })
        .on 'error', -> @emit 'end'
        .pipe istanbul.writeReports()
        .on 'end', cb

  return

gulp.task 'spec', ['test']

gulp.task 'docs', ->
  biscotto()
    .pipe gulp.dest './docs'

gulp.task 'build', ->
  gulp.src srcFiles
    .pipe coffee({ bare: true }).on('error', gutil.log)
    .pipe gulp.dest 'lib'

gulp.task 'ci', ->
  watcher = gulp.watch srcFiles.concat(['./spec/**/*']), ['test']
  watcher.on 'error', (err) ->
    console.log 'An error has occurred'
    console.dir err

gulp.task 'watch', ->
  watcher = gulp.watch srcFiles, ['build']
{'fraction_non_alphanumeric': 0.20122417750573834, 'fraction_numerical': 0.0, 'mean_word_length': 2.7680115273775217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2919705', 'n_tokens_mistral': 1009, 'n_tokens_neox': 985, 'n_words': 224}