<commit_before>'use strict';

var extend = require('extend');
var gulp = require('gulp');
var util = require('gulp-util');
var rump = require('rump');
var webpack = require('webpack');

gulp.task(rump.taskName('build:scripts'), function(callback) {
  var callbackCalled = false;
  var options = rump.configs.webpack;

  if(rump.configs.watch) {
    options = extend({}, options, {watch: true});
  }

  webpack(options, function(error, stats) {
    if(error) {
      throw new util.PluginError(rump.taskName('build:scripts'), error);
    }
    if(callbackCalled) {
      util.log(stats.toString({
        assets: false,
        chunks: false,
        colors: util.colors.supportsColor,
        hash: false,
        modules: false,
        reasons: false,
        source: false
      }));
    }
    else {
      callbackCalled = true;
      util.log(stats.toString({colors: util.colors.supportsColor}));
      callback();
    }
  });
});

gulp.tasks[rump.taskName('build')].dep.push(rump.taskName('build:scripts'));
gulp.tasks[rump.taskName('watch')].dep.push(rump.taskName('build:scripts'));<commit_msg>Formatting<commit_after>'use strict';

var extend = require('extend');
var gulp = require('gulp');
var util = require('gulp-util');
var rump = require('rump');
var webpack = require('webpack');

gulp.task(rump.taskName('build:scripts'), build);
gulp.tasks[rump.taskName('build')].dep.push(rump.taskName('build:scripts'));
gulp.tasks[rump.taskName('watch')].dep.push(rump.taskName('build:scripts'));

function build(callback) {
  var callbackCalled = false;
  var options = rump.configs.webpack;

  if(rump.configs.watch) {
    options = extend({}, options, {watch: true});
  }

  webpack(options, function(error, stats) {
    if(error) {
      throw new util.PluginError(rump.taskName('build:scripts'), error);
    }
    if(callbackCalled) {
      util.log(stats.toString({
        assets: false,
        chunks: false,
        colors: util.colors.supportsColor,
        hash: false,
        modules: false,
        reasons: false,
        source: false
      }));
    }
    else {
      callbackCalled = true;
      util.log(stats.toString({colors: util.colors.supportsColor}));
      callback();
    }
  });
}
{'fraction_non_alphanumeric': 0.16629010393131496, 'fraction_numerical': 0.0, 'mean_word_length': 3.43687374749499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6768423', 'n_tokens_mistral': 714, 'n_tokens_neox': 719, 'n_words': 127}