<commit_before>var fs = require('fs');
var util = require('util');
var _ = require('lodash');
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var browserify = require('gulp-browserify');
var less = require('gulp-less');
var concat = require('gulp-concat');
var template = require('gulp-template');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-minify-css');
var clean = require('gulp-clean');
var es = require('event-stream');
var runSequence = require('run-sequence');
var jsonToObject = require('./lib/gulp-json2obj');
var expandFiles = require('simple-glob');
var mkdirp = require('mkdirp');

var pkg = require('./package.json');
var files = require('./files');
process.env.MOCK_DATA_DIR = process.env.MOCK_DATA_DIR || 'data/sample';
process.env.FONTS_ENDPOINT = 'build/' + pkg.version + '/fonts';
process.env.IMAGES_ENDPOINT = 'build/' + pkg.version + '/images';
var jshintrc = JSON.parse(fs.readFileSync('.jshintrc'));
var testem = require('./testem.json');

gulp.task('jshint-app', function() {
  return gulp.src(['app/**/*.js', 'mock/**/*.js'])
    .pipe(jshint(jshintrc))
    .pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('jshint-test', function() {
  return gulp.src('test/**/*.js')
    .pipe(jshint(_.extend({}, jshintrc, {
      newcap: false,
      undef: false,
      expr: true
    })))
    .pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('jshint', ['jshint-app', 'jshint-test']);

gulp.task('jshint-watch', ['jshint'], function(cb){
  gulp.watch(['app/**/*.js', 'mock/**/*.js'], ['jshint-app']);

  gulp.watch('test/**/*.js', ['jshint-test']);

  console.log('Watching files for changes...');

  return cb();
});

gulp.task('scripts-config', function() {
  return gulp.src('app/config.js')
    .pipe(template({
      process: {env: process.env},
      pkg: pkg
    }))
    .pipe(uglify())
    .pipe(gulp.dest('dist/build/' + pkg.version));
});

gulp.task('scripts-browserify', function() {
  return gulp.src('app/app.js')
    .pipe(browserify({
      transform: ['reactify'],<commit_msg>Make JSHint task fail in CI environment<commit_after>var fs = require('fs');
var util = require('util');
var _ = require('lodash');
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var browserify = require('gulp-browserify');
var less = require('gulp-less');
var concat = require('gulp-concat');
var template = require('gulp-template');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-minify-css');
var clean = require('gulp-clean');
var es = require('event-stream');
var runSequence = require('run-sequence');
var jsonToObject = require('./lib/gulp-json2obj');
var expandFiles = require('simple-glob');
var mkdirp = require('mkdirp');

var pkg = require('./package.json');
var files = require('./files');
process.env.MOCK_DATA_DIR = process.env.MOCK_DATA_DIR || 'data/sample';
process.env.FONTS_ENDPOINT = 'build/' + pkg.version + '/fonts';
process.env.IMAGES_ENDPOINT = 'build/' + pkg.version + '/images';
var jshintrc = JSON.parse(fs.readFileSync('.jshintrc'));
var testem = require('./testem.json');

gulp.task('jshint-app', function() {
  var stream = gulp.src(['app/**/*.js', 'mock/**/*.js'])
    .pipe(jshint(jshintrc))
    .pipe(jshint.reporter('jshint-stylish'));

  if (process.env.CI) {
    stream = stream.pipe(jshint.reporter('fail'));
  }

  return stream;
});

gulp.task('jshint-test', function() {
  var stream = gulp.src('test/**/*.js')
    .pipe(jshint(_.extend({}, jshintrc, {
      newcap: false,
      undef: false,
      expr: true
    })))
    .pipe(jshint.reporter('jshint-stylish'));

  if (process.env.CI) {
    stream = stream.pipe(jshint.reporter('fail'));
  }

  return stream;
});

gulp.task('jshint', ['jshint-app', 'jshint-test']);

gulp.task('jshint-watch', ['jshint'], function(cb){
  gulp.watch(['app/**/*.js', 'mock/**/*.js'], ['jshint-app']);

  gulp.watch('test/**/*.js', ['jshint-test']);

  console.log('Watching files for changes...');

  return cb();
});

gulp.task('scripts-config', function() {
  return gulp.src('app/config.js')
    .pipe(template({
      process: {env: process.env},
      pkg: pkg
    }))
    .pipe(uglify())
    .pipe(gulp.dest('dist/build/' + pkg.version));
});

gulp.task('scripts-browserify', function() {
  return gulp.src('app/app.js')
    .pipe(browserify({
      transform: ['reactify'],
{'fraction_non_alphanumeric': 0.22217111315547378, 'fraction_numerical': 0.00045998160073597056, 'mean_word_length': 4.297198538367844, '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': '2788823', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1564, 'n_words': 279}