<commit_before>var gulp = require('gulp'),
	del = require('del'),
	plugins = require('gulp-load-plugins')(),
	livereload = require('gulp-livereload'),
	gutil = require('gulp-util'),
	source = require('vinyl-source-stream'),
	buffer = require('vinyl-buffer'),
	browserify = require('browserify'),
	to5ify = require('6to5ify'),
	uglify = require('gulp-uglify'),
	read = require('fs').readFileSync,
	base = './src/recipi',
	src = {
		foundation: 'bower_components/foundation/scss',
		templates: base + '/templates',
		scss: base + '/static/scss',
		fonts: base + '/static/fonts',
		images: base + '/static/img',
		js: base + '/static/js',
		manageScript: 'manage.py'
	},
	dest = {
		css: base + '/static/css',
		js: base + '/static/js/build'
	};

/**
 * Cleaning css directory
 */
gulp.task('clean:css', function (done) {
	del(dest.css, done);
});

/**
 * Cleaning js directory
 */
gulp.task('clean:js', function (done) {
	del(dest.js, done);
});

/**
 * Compiling sass/scss files to css
 */
gulp.task('scss', ['clean:css'], function () {
	return gulp.src(src.scss + '/*.scss')
		.pipe(plugins.plumber())
		.pipe(plugins.sourcemaps.init())
		.pipe(plugins.sass({
			includePaths: [src.foundation]
		}))
		.pipe(plugins.sourcemaps.write('./'))
		.pipe(gulp.dest(dest.css))
		.pipe(livereload());
});

/**
* Validating scss files
*/
gulp.task('validate:scss', function () {
	return gulp.src(src.scss + '/**/*.scss')
		.pipe(plugins.plumber())
		.pipe(plugins.lintspaces())
		.pipe(plugins.lintspaces.reporter());
});

/**
* Validating js files
*/
gulp.task('validate:js', function () {
	return gulp.src(src.js + '/*.js')
		.pipe(plugins.plumber())
		.pipe(plugins.jscs({
			preset: 'jquery'
		}))
		.pipe(plugins.jshint())
		.pipe(plugins.lintspaces())
		.pipe(plugins.lintspaces.reporter());
});

/**
* Building our javascript files
*/
gulp.task('js', function() {
	browserify(src.js + '/src/app.js', {debug: true})
		.transform(to5ify)
		.bundle()
		.on('error', gutil.log.bind(gutil, 'Browserify Error'))
		.pipe(source('bundle.js'))
		.pipe(buffer())
		.pipe(plugins.sourcemaps.init({loadMaps: true})) // loads map from browserify file
		.pipe(uglify())
		.pipe(plugins.sourcemaps.write('./')) // writes .map file
		.pipe(gulp.dest(src.js + '/build'))
		.pipe(livereload());
});

/**
* Validating files
*/
gulp.task('validate', ['validate:scss', 'validate:js']);

gulp.task('watch', function () {
	gulp.watch(src.js + '/src/*.js', ['validate:js', 'js']);
	gulp.watch(src.scss + '/**/*.scss', ['validate:scss', 'scss']);
	livereload.listen();
});

gulp.task('build', ['validate', 'js', 'scss']);

gulp.task('default', ['build']);

gulp.task('serve', ['default', 'watch'], plugins.shell.task([
	'env PYTHONUNBUFFERED=true python ' + src.manageScript + ' runserver',
	'env PYTHONUNBUFFERED=true celery worker -A recipi.core.tasks -l INFO -E',<commit_msg>debug bundle<commit_after>var gulp = require('gulp'),
	del = require('del'),
	plugins = require('gulp-load-plugins')(),
	livereload = require('gulp-livereload'),
	gutil = require('gulp-util'),
	source = require('vinyl-source-stream'),
	buffer = require('vinyl-buffer'),
	browserify = require('browserify'),
	to5ify = require('6to5ify'),
	uglify = require('gulp-uglify'),
	read = require('fs').readFileSync,
	base = './src/recipi',
	src = {
		foundation: 'bower_components/foundation/scss',
		templates: base + '/templates',
		scss: base + '/static/scss',
		fonts: base + '/static/fonts',
		images: base + '/static/img',
		js: base + '/static/js',
		manageScript: 'manage.py'
	},
	dest = {
		css: base + '/static/css',
		js: base + '/static/js/build'
	};

/**
 * Cleaning css directory
 */
gulp.task('clean:css', function (done) {
	del(dest.css, done);
});

/**
 * Cleaning js directory
 */
gulp.task('clean:js', function (done) {
	del(dest.js, done);
});

/**
 * Compiling sass/scss files to css
 */
gulp.task('scss', ['clean:css'], function () {
	return gulp.src(src.scss + '/*.scss')
		.pipe(plugins.plumber())
		.pipe(plugins.sourcemaps.init())
		.pipe(plugins.sass({
			includePaths: [src.foundation]
		}))
		.pipe(plugins.sourcemaps.write('./'))
		.pipe(gulp.dest(dest.css))
		.pipe(livereload());
});

/**
* Validating scss files
*/
gulp.task('validate:scss', function () {
	return gulp.src(src.scss + '/**/*.scss')
		.pipe(plugins.plumber())
		.pipe(plugins.lintspaces())
		.pipe(plugins.lintspaces.reporter());
});

/**
* Validating js files
*/
gulp.task('validate:js', function () {
	return gulp.src(src.js + '/*.js')
		.pipe(plugins.plumber())
		.pipe(plugins.jscs({
			preset: 'jquery'
		}))
		.pipe(plugins.jshint())
		.pipe(plugins.lintspaces())
		.pipe(plugins.lintspaces.reporter());
});

/**
* Building our javascript files
*/
gulp.task('js', function() {
	browserify(src.js + '/src/app.js', {debug: true})
		.transform(to5ify)
		.bundle({debug: true})
		.on('error', gutil.log.bind(gutil, 'Browserify Error'))
		.pipe(source('bundle.js'))
		.pipe(buffer())
		.pipe(plugins.sourcemaps.init({loadMaps: true})) // loads map from browserify file
		.pipe(uglify())
		.pipe(plugins.sourcemaps.write('./')) // writes .map file
		.pipe(gulp.dest(src.js + '/build'))
		.pipe(livereload());
});

/**
* Validating files
*/
gulp.task('validate', ['validate:scss', 'validate:js']);

gulp.task('watch', function () {
	gulp.watch(src.js + '/src/*.js', ['validate:js', 'js']);
	gulp.watch(src.scss + '/**/*.scss', ['validate:scss', 'scss']);
	livereload.listen();
});

gulp.task('build', ['validate', 'js', 'scss']);

gulp.task('default', ['build']);

gulp.task('serve', ['default', 'watch'], plugins.shell.task([
	'env PYTHONUNBUFFERED=true python ' + src.manageScript + ' runserver',
	'env PYTHONUNBUFFERED=true celery worker -A recipi.core.tasks -l INFO -E',
{'fraction_non_alphanumeric': 0.22881652661064425, 'fraction_numerical': 0.0014005602240896359, 'mean_word_length': 4.294717330861909, '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': '7604493', 'n_tokens_mistral': 2236, 'n_tokens_neox': 2119, 'n_words': 373}