<commit_before>/*jshint unused:true */
'use strict';

var exec = require('child_process').exec;

var $ = require('gulp-load-plugins')();
var gulp = require('gulp');
var mergeStream = require('merge-stream');
var rimraf = require('rimraf');
var stylish = require('jshint-stylish');
var toCamelCase = require('to-camel-case');

var pkg = require('./package.json');
var bower = require('./bower.json');
var funName = toCamelCase(pkg.name);

var banner = [
  '/*!',
  ' * String.prototype.codePointAt v0.2.0 | MIT (c) <NAME> (@mathias)',
  ' * http://mths.be/codepointat',
  ' *',
  ' * code-point | MIT (c) <NAME>',
  ' * https://github.com/shinnn/code-point.js',
  '*/\n'
].join('\n');

gulp.task('lint', function() {
  gulp.src(['{,src/}*.js'])
    .pipe($.jshint())
    .pipe($.jshint.reporter(stylish))
    .pipe($.jscs('.jscs.json'));
  gulp.src('*.json')
    .pipe($.jsonlint())
    .pipe($.jsonlint.reporter());
});

gulp.task('clean', rimraf.bind(null, 'dist'));

gulp.task('build', ['lint', 'clean'], function() {
  return mergeStream(
    gulp.src(['src/*.js'])
      .pipe($.header(banner + '!function() {\n', {pkg: pkg}))
      .pipe($.footer('\nwindow.<%= funName %> = <%= funName %>;\n}();\n', {
        funName: funName
      }))
      .pipe($.rename(bower.main))
      .pipe(gulp.dest('')),
    gulp.src(['src/*.js'])
      .pipe($.header(banner, {pkg: pkg}))
      .pipe($.footer('\nmodule.exports = <%= funName %>;\n', {funName: funName}))
      .pipe($.rename(pkg.main))
      .pipe(gulp.dest(''))
  );
});

gulp.task('test', ['build'], function(cb) {
  exec('node test.js', function(err, stderr, stdout) {
    console.log(stderr);
    console.log(stdout);
    cb(err);
  });
});

gulp.task('watch', function() {
  gulp.watch(['{,src/}*.js'], ['test']);
  gulp.watch(['*.json', '.jshintrc'], ['lint']);
});

gulp.task('default', ['test', 'watch']);<commit_msg>tweak gulpfile<commit_after>/*jshint unused:true */
'use strict';

var exec = require('child_process').exec;

var $ = require('gulp-load-plugins')();
var gulp = require('gulp');
var mergeStream = require('merge-stream');
var rimraf = require('rimraf');
var stylish = require('jshint-stylish');
var toCamelCase = require('to-camel-case');

var pkg = require('./package.json');
var bower = require('./bower.json');
var funName = toCamelCase(pkg.name);

var banner = [
  '/*!',
  ' * String.prototype.codePointAt v0.2.0 | MIT (c) <NAME> (@mathias)',
  ' * http://mths.be/codepointat',
  ' *',
  ' * code-point | MIT (c) <NAME>',
  ' * https://github.com/shinnn/code-point.js',
  '*/\n'
].join('\n');

gulp.task('lint', function() {
  gulp.src('{,src/}*.js')
    .pipe($.jscs(pkg.jscsConfig))
    .pipe($.jshint())
    .pipe($.jshint.reporter(stylish))
    .pipe($.jshint.reporter('fail'));
  gulp.src('*.json')
    .pipe($.jsonlint())
    .pipe($.jsonlint.reporter());
});

gulp.task('clean', rimraf.bind(null, 'dist'));

gulp.task('build', ['lint', 'clean'], function() {
  return mergeStream(
    gulp.src('src/*.js')
      .pipe($.header(banner + '!function() {\n', {pkg: pkg}))
      .pipe($.footer('\nwindow.<%= funName %> = <%= funName %>;\n}();\n', {
        funName: funName
      }))
      .pipe($.rename(bower.main)),
    gulp.src('src/*.js')
      .pipe($.header(banner, {pkg: pkg}))
      .pipe($.footer('\nmodule.exports = <%= funName %>;\n', {funName: funName}))
      .pipe($.rename(pkg.main))
  )
    .pipe(gulp.dest(''));
});

gulp.task('test', ['build'], function(cb) {
  exec('node test.js', function(err, stdout, stderr) {
    process.stdout.write(stdout);
    process.stderr.write(stderr);
    cb(err);
  });
});

gulp.task('watch', function() {
  gulp.watch('{,src/}*.js', ['test']);
  gulp.watch('{*.json,.jshintrc}', ['lint']);
});

gulp.task('default', ['test', 'watch']);
{'fraction_non_alphanumeric': 0.2676392572944297, 'fraction_numerical': 0.0015915119363395225, 'mean_word_length': 3.6728624535315983, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '4061747', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1449, 'n_words': 225}