<commit_before>/**
 * gulp-fail v1.0.6
 * Copyright (c) 2016 <NAME> (http://bsara.github.io)
 * Licensed under the MIT License
 */

'use strict';


// Dependencies
// -----------------

var gutil   = require('gulp-util');
var through = require('through2');

var PluginError = gutil.PluginError;



// Constants
// -----------------

var PLUGIN_NAME = 'gulp-fail';



// Task Definition
// -----------------

function gulpFail(message, failAfterCompletion) {

  var shouldFail = false;
  var getMessage = message;



  if (typeof getMessage !== 'function') {
    getMessage = function() {
      return (message || "Task was forced to fail.");
    };
  }



  var getError = function() {
    return new PluginError(PLUGIN_NAME, gutil.colors.red(getMessage()), { showStack: false });
  };


  var checkFile = function(file, _e, cb) {
    if (failAfterCompletion !== true) {
      cb(getError());
      return;
    }
  
    shouldFail = true;
  
    cb(null, file);
  };
  
  
  var checkStream = function() {
    if (failAfterCompletion === true && shouldFail) {
      this.emit('error', getError());
      return;
    }
    this.emit('end');
  };


  var onError = function() {
    this.emit('end');
  };


<commit_msg>getting rid of trailing spaces<commit_after>/**
 * gulp-fail v1.0.6
 * Copyright (c) 2016 <NAME> (http://bsara.github.io)
 * Licensed under the MIT License
 */

'use strict';


// Dependencies
// -----------------

var gutil   = require('gulp-util');
var through = require('through2');

var PluginError = gutil.PluginError;



// Constants
// -----------------

var PLUGIN_NAME = 'gulp-fail';



// Task Definition
// -----------------

function gulpFail(message, failAfterCompletion) {

  var shouldFail = false;
  var getMessage = message;



  if (typeof getMessage !== 'function') {
    getMessage = function() {
      return (message || "Task was forced to fail.");
    };
  }



  var getError = function() {
    return new PluginError(PLUGIN_NAME, gutil.colors.red(getMessage()), { showStack: false });
  };


  var checkFile = function(file, _e, cb) {
    if (failAfterCompletion !== true) {
      cb(getError());
      return;
    }

    shouldFail = true;

    cb(null, file);
  };


  var checkStream = function() {
    if (failAfterCompletion === true && shouldFail) {
      this.emit('error', getError());
      return;
    }
    this.emit('end');
  };


  var onError = function() {
    this.emit('end');
  };



{'fraction_non_alphanumeric': 0.190749079001228, 'fraction_numerical': 0.006549324600900532, 'mean_word_length': 2.380359612724758, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7158434', 'n_tokens_mistral': 810, 'n_tokens_neox': 757, 'n_words': 186}