<commit_before>var gulp = require('gulp');
var debug = require('gulp-debug');
var del = require('del');

var webserver = require('gulp-webserver');
var watch = require('gulp-watch');
var mainBowerFiles = require('main-bower-files');
var concat = require('gulp-concat');
var bower = require('gulp-bower');
var livereload = require('gulp-livereload');
var templateCache = require('gulp-angular-templatecache');
var cachebreaker = require('gulp-cache-breaker');
var eslint = require('gulp-eslint');
var karma = require('gulp-karma');
var sass = require('gulp-sass');

module.exports = function(gulp) {

  var config = {
    build_dir: './build/',
    files: {
      js: {
        app: ['src/**/*.js', '!src/**/*.spec.js'],
        spec: 'src/**/*.spec.js',
        templates: 'src/**/*.tpl.html',
        test: [
          'build/vendor-spec.js',
          'build/templates.js',
          'src/**/*.js',
          'src/**/*.spec.js'
        ]
      },
      static_assets: {
        app: [
          'src/assets/**/*'
        ]
      },
      static_files: {
        app: [
          'src/**/*.html',
          '!src/**/*.tpl.html',
          'src/**/*.json'
        ]
      },
      css : {
        app: 'src/**/*.scss'
      }
    }
  };

  gulp.task('webserver', ['angular-build', 'watch'], function() {
    gulp.src('build')
      .pipe(webserver({
        host: '0.0.0.0',
        port: 8000
      }));
  });

  gulp.task('angular-build', [
    'build-vendor', 'build-app-js', 'build-app-static-assets', 'build-app-static-files','build-app-templates', 'build-app-sass'
    ], function() {

  });

  gulp.task('angular-build-spec', [
    'build-vendor-spec', 'build-app-js', 'build-app-static-assets', 'build-app-static-files','build-app-templates', 'build-app-sass'
    ], function() {

  });

  gulp.task('watch', function() {
    watch(config.files.js.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationJavascript();
    });

    watch(config.files.css.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationCSS();
    });

    watch(config.files.static_assets.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationStaticAssets();
    });

    watch(config.files.static_files.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationStaticFiles();
    });

    watch(config.files.js.templates, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationTemplates();
    });

    livereload.listen({
      quiet: true
    });
  });

  gulp.task('karma-watch', function() {
    gulp.src(config.files.js.test)
      .pipe(karma({
        configFile: 'karma.conf.js',
        action: 'watch'
      }));
  });

  gulp.task('karma', ['angular-build-spec'], function() {
    var stream = gulp.src([
        'build/vendor-spec.js',
        'build/templates.js',
        'build/application.js',
        'src/**/*.spec.js'
      ])
      .pipe(karma({
        configFile: 'karma.conf.js',
        action: 'run'
      }))
      .on('error', function(err) {
        // Make sure failed tests cause gulp to exit non-zero
        throw err;
      });
    return stream;
  });

  function buildApplicationJavascript() {
    var stream = gulp.src(config.files.js.app)
      .pipe(eslint())
      .pipe(eslint.format())
      .pipe(eslint.failOnError())
      .pipe(concat('application.js'))
      .pipe(gulp.dest(config.build_dir))
      .pipe(livereload());
    return stream;
  }

  gulp.task('build-app-js', function() {
    return buildApplicationJavascript();
  });

  function buildApplicationStaticFiles () {
    var stream = gulp.src(config.files.static_files.app)
      .pipe(gulp.dest(config.build_dir))
      .pipe(cachebreaker(config.build_dir))
      .pipe(gulp.dest(config.build_dir))
      .pipe(livereload());<commit_msg>Eslint no longer stops gulp execution when finding an error<commit_after>var gulp = require('gulp');
var debug = require('gulp-debug');
var del = require('del');

var webserver = require('gulp-webserver');
var watch = require('gulp-watch');
var mainBowerFiles = require('main-bower-files');
var concat = require('gulp-concat');
var bower = require('gulp-bower');
var livereload = require('gulp-livereload');
var templateCache = require('gulp-angular-templatecache');
var cachebreaker = require('gulp-cache-breaker');
var eslint = require('gulp-eslint');
var karma = require('gulp-karma');
var sass = require('gulp-sass');

module.exports = function(gulp) {

  var config = {
    build_dir: './build/',
    files: {
      js: {
        app: ['src/**/*.js', '!src/**/*.spec.js'],
        spec: 'src/**/*.spec.js',
        templates: 'src/**/*.tpl.html',
        test: [
          'build/vendor-spec.js',
          'build/templates.js',
          'src/**/*.js',
          'src/**/*.spec.js'
        ]
      },
      static_assets: {
        app: [
          'src/assets/**/*'
        ]
      },
      static_files: {
        app: [
          'src/**/*.html',
          '!src/**/*.tpl.html',
          'src/**/*.json'
        ]
      },
      css : {
        app: 'src/**/*.scss'
      }
    }
  };

  gulp.task('webserver', ['angular-build', 'watch'], function() {
    gulp.src('build')
      .pipe(webserver({
        host: '0.0.0.0',
        port: 8000
      }));
  });

  gulp.task('angular-build', [
    'build-vendor', 'build-app-js', 'build-app-static-assets', 'build-app-static-files','build-app-templates', 'build-app-sass'
    ], function() {

  });

  gulp.task('angular-build-spec', [
    'build-vendor-spec', 'build-app-js', 'build-app-static-assets', 'build-app-static-files','build-app-templates', 'build-app-sass'
    ], function() {

  });

  gulp.task('watch', function() {
    watch(config.files.js.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationJavascript();
    });

    watch(config.files.css.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationCSS();
    });

    watch(config.files.static_assets.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationStaticAssets();
    });

    watch(config.files.static_files.app, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationStaticFiles();
    });

    watch(config.files.js.templates, {
      verbose: true
    },
    function(vinyl) {
      buildApplicationTemplates();
    });

    livereload.listen({
      quiet: true
    });
  });

  gulp.task('karma-watch', function() {
    gulp.src(config.files.js.test)
      .pipe(karma({
        configFile: 'karma.conf.js',
        action: 'watch'
      }));
  });

  gulp.task('karma', ['angular-build-spec'], function() {
    var stream = gulp.src([
        'build/vendor-spec.js',
        'build/templates.js',
        'build/application.js',
        'src/**/*.spec.js'
      ])
      .pipe(karma({
        configFile: 'karma.conf.js',
        action: 'run'
      }))
      .on('error', function(err) {
        // Make sure failed tests cause gulp to exit non-zero
        throw err;
      });
    return stream;
  });

  function buildApplicationJavascript() {
    var stream = gulp.src(config.files.js.app)
      .pipe(eslint())
      .pipe(eslint.format())
      .pipe(concat('application.js'))
      .pipe(gulp.dest(config.build_dir))
      .pipe(livereload());
    return stream;
  }

  gulp.task('build-app-js', function() {
    return buildApplicationJavascript();
  });

  function buildApplicationStaticFiles () {
    var stream = gulp.src(config.files.static_files.app)
      .pipe(gulp.dest(config.build_dir))
      .pipe(cachebreaker(config.build_dir))
      .pipe(gulp.dest(config.build_dir))
      .pipe(livereload());
{'fraction_non_alphanumeric': 0.1875, 'fraction_numerical': 0.0020833333333333333, 'mean_word_length': 2.343926861123204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2024710', 'n_tokens_mistral': 2617, 'n_tokens_neox': 2538, 'n_words': 389}