<commit_before>var gulp = require('gulp'),
    plugins = require('gulp-load-plugins')(),
    browserify = require('browserify'),
    source = require('vinyl-source-stream'),
    buffer = require('vinyl-buffer'),
    gutil = require('gulp-util'),
    // Temporary solution until gulp 4
    // https://github.com/gulpjs/gulp/issues/355
    runSequence = require('run-sequence'),
    Server = require('karma').Server,
    argv = require('yargs').argv,
    gulpif = require('gulp-if'),
    es6Conf = require('./esixstarter-conf.json'),
    dirs = es6Conf.dirs,
    banner = '/* ' + es6Conf.name + ' v' + es6Conf.version +
            ' | ' + es6Conf.author + ' */\n\n';


// -------- HELPER TASKS

gulp.task('lint:js', function () {
  return gulp.src([
      'gulpfile.js',
      dirs.src + '/js/*.js',
      dirs.test + '/*.spec.js'
  ]).pipe(plugins.plumber())
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('jshint-stylish'))
    .pipe(plugins.jshint.reporter('fail'));
});

gulp.task('clean', function (done) {
  require('del')([
      dirs.dist
  ]).then(function () {
      done();
  });
});

gulp.task('scripts', function (done) {
  var b = browserify({
   entries: [dirs.src + '/js/main.js'],
   debug: true,
   transform: [["babelify", { "presets": ["es2015"] }]]
  });

  return b.bundle()
    .pipe(source('main.js'))
    .pipe(buffer())
    // sourcemaps
    .pipe(plugins.sourcemaps.init({loadMaps: true}))
    .pipe(plugins.uglify({mangle:true}))
      .on('error', gutil.log)
    .pipe(plugins.sourcemaps.write('./'))
    // .pipe(plugins.header(banner))
    .pipe(gulp.dest(dirs.dist + '/js'))
    .on('end', function () {
      gulp.src(dirs.dist + '/**/*')
        .pipe(plugins.connect.reload());
    });
});

gulp.task('styles', function () {
  return gulp.src([
        dirs.src + '/less/*.less'
  ]).pipe(plugins.header(banner))
    .pipe(plugins.plumber())
    .pipe(plugins.less())
    .pipe(plugins.autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
        }))
    .pipe(gulpif(argv.production,plugins.cssnano()))
    .pipe(plugins.concat('main.min.css'))
    .pipe(gulp.dest(dirs.dist + '/css'))
    .on('end', function () {
      gulp.src(dirs.dist + '/**/*')
        .pipe(plugins.connect.reload());
    });
});

gulp.task('source', function () {
  return gulp.src([
      dirs.src + '/**/*',
      '!' + dirs.src + '/less/*.less',
      '!' + dirs.src + '/less',
      '!' + dirs.src + '/js/*.js'<commit_msg>Fix: source map not working with the project banner<commit_after>var gulp = require('gulp'),
    plugins = require('gulp-load-plugins')(),
    browserify = require('browserify'),
    source = require('vinyl-source-stream'),
    buffer = require('vinyl-buffer'),
    gutil = require('gulp-util'),
    // Temporary solution until gulp 4
    // https://github.com/gulpjs/gulp/issues/355
    runSequence = require('run-sequence'),
    Server = require('karma').Server,
    argv = require('yargs').argv,
    gulpif = require('gulp-if'),
    es6Conf = require('./esixstarter-conf.json'),
    dirs = es6Conf.dirs,
    banner = '/* ' + es6Conf.name + ' v' + es6Conf.version +
            ' | ' + es6Conf.author + ' */\n\n';


// -------- HELPER TASKS

gulp.task('lint:js', function () {
  return gulp.src([
      'gulpfile.js',
      dirs.src + '/js/*.js',
      dirs.test + '/*.spec.js'
  ]).pipe(plugins.plumber())
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('jshint-stylish'))
    .pipe(plugins.jshint.reporter('fail'));
});

gulp.task('clean', function (done) {
  require('del')([
      dirs.dist
  ]).then(function () {
      done();
  });
});

gulp.task('scripts', function (done) {
  var b = browserify({
   entries: [dirs.src + '/js/main.js'],
   debug: true,
   transform: [["babelify", { "presets": ["es2015"] }]]
  });

  return b.bundle()
    .pipe(source('main.js'))
    .pipe(buffer())
    // sourcemaps
    .pipe(plugins.sourcemaps.init({loadMaps: true}))
    .pipe(plugins.uglify({mangle:true}))
      .on('error', gutil.log)
    .pipe(plugins.sourcemaps.write('./'))
    .pipe(gulp.dest(dirs.dist + '/js'))
    .on('end', function () {
      gulp.src([
          dirs.dist + '/**/*.js',
          '!' + dirs.dist + '/js/main.js.map'
        ]).pipe(plugins.header(banner))
        .pipe(plugins.connect.reload());
    });
});

gulp.task('styles', function () {
  return gulp.src([
        dirs.src + '/less/*.less'
  ]).pipe(plugins.header(banner))
    .pipe(plugins.plumber())
    .pipe(plugins.less())
    .pipe(plugins.autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
        }))
    .pipe(gulpif(argv.production,plugins.cssnano()))
    .pipe(plugins.concat('main.min.css'))
    .pipe(gulp.dest(dirs.dist + '/css'))
    .on('end', function () {
      gulp.src(dirs.dist + '/**/*.css')
        .pipe(plugins.connect.reload());
    });
});

gulp.task('source', function () {
  return gulp.src([
      dirs.src + '/**/*',
      '!' + dirs.src + '/less/*.less',
      '!' + dirs.src + '/less',
      '!' + dirs.src + '/js/*.js'
{'fraction_non_alphanumeric': 0.22555205047318613, 'fraction_numerical': 0.005520504731861199, 'mean_word_length': 2.620985010706638, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '6758770', 'n_tokens_mistral': 1852, 'n_tokens_neox': 1819, 'n_words': 266}