<commit_before>'use strict';

const gulp = require('gulp');

module.exports = function (config, browsersync) {
	gulp.task('simple-reload', () => {
		browsersync.reload();
	});

	gulp.task('simple-stream', () => {
		return gulp.src(config.srcFolder + '/css/**/*.css')
			.pipe(browsersync.stream({
				match: '**/*.css'
			}));
	});

	gulp.task('watch', done => {
		// Defaults tasks for a simple flow (not advanced)
		let jsTasks = 'simple-reload';
		let styleTasks = 'simple-stream';
		let otherTasks = 'simple-reload';

		if (config.mode === 'advanced') {
			if (config.js.processor === 'webpack') {
				jsTasks = 'webpack-watch';
			} else if (config.js.processor === 'typescript') {
				jsTasks = 'ts-watch';
			} else {
				jsTasks = 'js-watch';
			}

			styleTasks = 'style-watch';
			otherTasks = 'other-watch';
		}

		// Watch for js and ts
		gulp.watch('**/*.{js,ts}', {
			cwd: config.srcFolder + '/js/'
		}, gulp.series(jsTasks));

		// Watch for style files (scss, sass, less, css)
		// activates theme roller for (scss, sass, less)
		gulp.watch('**/*.scss', {
			cwd: config.srcFolder + '/scss/'
		}, gulp.parallel('style-watch', 'themeroller'));
		gulp.watch('**/*.sass', {
			cwd: config.srcFolder + '/sass/'
		}, gulp.parallel('style-watch', 'themeroller'));
		gulp.watch('**/*.less', {
			cwd: config.srcFolder + '/less/'
		}, gulp.parallel('style-watch', 'themeroller'));
		gulp.watch('**/*.css', {
			cwd: config.srcFolder + '/css/'
		}, gulp.series(styleTasks));

		// All files except js, scss, sass, less, css
		const otherFiles = [
			'**/*.*',
			'!js/**/*.js',
			'!scss/**/*.scss',
			'!sass/**/*.sass',
			'!less/**/*.less',
			'!css/**/*.css'
		];
		gulp.watch(otherFiles, {
			cwd: config.srcFolder
		}, gulp.series(otherTasks));

		done();
	});
};
<commit_msg>prevents theme roller task from running when there are no files<commit_after>'use strict';

const gulp = require('gulp');

module.exports = function (config, browsersync) {
	gulp.task('simple-reload', () => {
		browsersync.reload();
	});

	gulp.task('simple-stream', () => {
		return gulp.src(config.srcFolder + '/css/**/*.css')
			.pipe(browsersync.stream({
				match: '**/*.css'
			}));
	});

	gulp.task('watch', done => {
		// Defaults tasks for a simple flow (not advanced)
		let jsTasks = ['simple-reload'];
		let styleTasks = ['simple-stream'];
		let otherTasks = ['simple-reload'];

		if (config.mode === 'advanced') {
			if (config.js.processor === 'webpack') {
				jsTasks = ['webpack-watch'];
			} else if (config.js.processor === 'typescript') {
				jsTasks = ['ts-watch'];
			} else {
				jsTasks = ['js-watch'];
			}

			styleTasks = ['style-watch'];
			otherTasks = ['other-watch'];
		}

		// Theme roller support for sass or less files
		if ((config.css.language === 'sass' || config.css.language === 'less') &&
			(config.themeroller && config.themeroller.files.length > 0)) {
			styleTasks.unshift('themeroller');
		}

		// Watch for js and ts
		gulp.watch('**/*.{js,ts}', {
			cwd: config.srcFolder + '/js/'
		}, gulp.series(jsTasks));

		// Watch for style files (scss, sass, less, css)
		// activates theme roller for (scss, sass, less)
		gulp.watch('**/*.scss', {
			cwd: config.srcFolder + '/scss/'
		}, gulp.parallel(styleTasks));
		gulp.watch('**/*.sass', {
			cwd: config.srcFolder + '/sass/'
		}, gulp.parallel(styleTasks));
		gulp.watch('**/*.less', {
			cwd: config.srcFolder + '/less/'
		}, gulp.parallel(styleTasks));
		gulp.watch('**/*.css', {
			cwd: config.srcFolder + '/css/'
		}, gulp.series(styleTasks));

		// All files except js, scss, sass, less, css
		const otherFiles = [
			'**/*.*',
			'!js/**/*.js',
			'!scss/**/*.scss',
			'!sass/**/*.sass',
			'!less/**/*.less',
			'!css/**/*.css'
		];
		gulp.watch(otherFiles, {
			cwd: config.srcFolder
		}, gulp.series(otherTasks));

		done();
	});
};

{'fraction_non_alphanumeric': 0.22817564035546262, 'fraction_numerical': 0.00026136957658128593, 'mean_word_length': 3.1643090315560394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '3779947', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1413, 'n_words': 276}