<commit_before>var gulp = require('gulp'),
    _ = require('underscore'),
    jshint = require('gulp-jshint'),
    karma = require('gulp-karma'),
    rjs = require('gulp-requirejs'),
    uglify = require('gulp-uglify'),
    replace = require('gulp-replace'),
    less = require('gulp-less'),
    csso = require('gulp-csso');

// Configuration
var conf = {
    js: {
        test: {
            config: 'src/js/test/karma.conf.js',
            perfConfig: 'src/js/test/karma.perf.conf.js',
            files: 'test/spec/**/*.js'
        },
        rjs: {
            baseUrl: 'src/js',
            mainConfigFile: 'src/js/config.js',
            name: 'components/almond/almond',
            include: ['app'],
            insertRequire: ['app'],
            almond: true,
            inlineText: true,
            preserveLicenseComments: false
        },
        charts: ['chart', 'bar', 'bubble', 'geo', 'line'],
        outDir: 'dist/js/'
    },
    less: {
        src: 'src/less/dataseed.less',
        paths: ['src/less/'],
        outDir: 'dist/css/'
    }
};

// Lint JS
gulp.task('lint', function() {
    return gulp.src([
            conf.js.rjs.baseUrl + '/**/*.js',
            '!' + conf.js.rjs.baseUrl + '/components/**/*.js',
            '!' + conf.js.test.config,
            '!' + conf.js.test.perfConfig
        ])
        .pipe(jshint({
            sub: true
        }))
        .pipe(jshint.reporter('default'));
});

// Test JS
gulp.task('test', function() {
    return gulp.src(conf.js.test.files)
        .pipe(karma({
            configFile: conf.js.test.config,
            action: 'run'
        }))
        .on('error', function(err) {
            throw err;
        });
});

// Test JS (watch)
gulp.task('watch', function() {
    return gulp.src(conf.js.test.files)
        .pipe(karma({
            configFile: conf.js.test.config,
            action: 'watch',
            logLevel: 'debug'
        }));
});

// Performance Test JS
gulp.task('test-perf', function() {
    return gulp.src(conf.js.test.files)
        .pipe(karma({
            configFile: conf.js.test.perfConfig,
            action: 'run'
        }))
        .on('error', function(err) {
            throw err;
        });
});

// Compile JS (d3)
gulp.task('js-d3', function() {
    return rjs(_.extend({}, conf.js.rjs, {
            out: 'dataseed.js'
        }))
        .pipe(uglify({
            outSourceMap: false
        }))
        .pipe(replace(/\s+/g, ' '))
        .pipe(gulp.dest(conf.js.outDir));
});

// Compile JS (Highcharts)
gulp.task('js-highcharts', function() {
    var basePath = 'views/element/',
        paths = _.object(_.map(conf.js.charts, function(module) {
            return [basePath + 'd3/' + module, basePath + 'highcharts/' + module];
        }));
    return rjs(_.extend({}, conf.js.rjs, {
            paths: paths,
            out: 'dataseed-highcharts.js'
        }))
        .pipe(uglify({
            outSourceMap: false
        }))
        .pipe(replace(/\s+/g, ' '))
        .pipe(gulp.dest(conf.js.outDir));
});

// Compile LESS
gulp.task('less', function () {
    return gulp.src(conf.less.src)
        .pipe(less({
            paths: conf.less.paths
        }))
        .pipe(csso())
        .pipe(gulp.dest(conf.less.outDir));
});

// Default
gulp.task('default', ['lint', 'test', 'js-d3', 'js-highcharts', 'less']);<commit_msg>Fix dataset featured column migration script<commit_after>var gulp = require('gulp'),
    _ = require('underscore'),
    jshint = require('gulp-jshint'),
    karma = require('gulp-karma'),
    rjs = require('gulp-requirejs'),
    uglify = require('gulp-uglify'),
    replace = require('gulp-replace'),
    less = require('gulp-less'),
    csso = require('gulp-csso');

// Lint JS
gulp.task('lint', function() {
    return gulp.src([
            'src/js/**/*.js',
            '!src/js/components/**/*.js',
            '!src/js/test/karma.conf.js',
            '!src/js/test/karma.perf.conf.js'
        ])
        .pipe(jshint({sub: true}))
        .pipe(jshint.reporter('default'));
});

// Test JS
gulp.task('test', function() {
    return gulp.src('test/spec/**/*.js')
        .pipe(karma({configFile: 'src/js/test/karma.conf.js', action: 'run'}))
        .on('error', function(err) { throw err; });
});

// Performance Test JS
gulp.task('test-perf', function() {
    return gulp.src('test/spec/**/*.js')
        .pipe(karma({configFile: 'src/js/test/karma.perf.conf.js', action: 'run'}))
        .on('error', function(err) { throw err; });
});

// Test JS (watch)
gulp.task('watch', function() {
    return gulp.src('test/spec/**/*.js')
        .pipe(karma({configFile: 'src/js/test/karma.conf.js', action: 'watch', logLevel: 'debug'}));
});

// Compile JS
var rjs_config = {
    baseUrl: 'src/js',
    mainConfigFile: 'src/js/config.js',
    name: 'components/almond/almond',
    include: ['app'],
    insertRequire: ['app'],
    almond: true,
    inlineText: true,
    preserveLicenseComments: false
};

// D3
gulp.task('js-d3', function() {
    return rjs(_.extend({out: 'dataseed.js'}, rjs_config))
        .pipe(uglify({outSourceMap: false}))
        .pipe(replace(/\s+/g, ' '))
        .pipe(gulp.dest('dist/js/'));
});

// Highcharts
gulp.task('js-highcharts', function() {
    var basePath = 'views/element/',
        paths = _.object(_.map(['chart', 'bar', 'bubble', 'geo', 'line'], function(module) {
            return [basePath + 'd3/' + module, basePath + 'highcharts/' + module];
        }));
    return rjs(_.extend({paths: paths, out: 'dataseed-highcharts.js'}, rjs_config))
        .pipe(uglify({outSourceMap: false}))
        .pipe(replace(/\s+/g, ' '))
        .pipe(gulp.dest('dist/js/'));
});

// Compile LESS
gulp.task('less', function () {
    return gulp.src('src/less/dataseed.less')
        .pipe(less({paths: ['src/less/']}))
        .pipe(csso())
        .pipe(gulp.dest('dist/css/'));
});

// Default
gulp.task('default', ['lint', 'test', 'js-d3', 'js-highcharts', 'less']);
{'fraction_non_alphanumeric': 0.20552763819095476, 'fraction_numerical': 0.001340033500837521, 'mean_word_length': 2.1676392572944296, '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': '6662786', 'n_tokens_mistral': 2090, 'n_tokens_neox': 2066, 'n_words': 340}