<commit_before>var gulp = require('gulp');
var tap = require('gulp-tap');
var gutil = require('gulp-util');
var cssstats = require('gulp-cssstats');
var config = require('./../config');


gulp.task('cssstats', function () {

	return gulp.src([
			config.global.dist + '/resources/css/styles.all.min.css'
		])
		.pipe(cssstats())
		.pipe(tap(function (file) {
			var stats = JSON.parse(file.contents.toString());
			var filepath = file.path.substr(0, file.path.length - 4) + 'css';

			gutil.log(gutil.colors.blue('CSS Stats for ' + filepath));
			gutil.log(gutil.colors.green('Minified: ' + (stats.size / 1024).toFixed(2) + ' KB'));
			gutil.log(gutil.colors.green('Gzipped: ' + (stats.gzipSize / 1024).toFixed(2) + ' KB'));

			// IE9 selector limit
			if (stats.selectors.total > 4095) {
				throw new gutil.PluginError('cssstats', 'Too much selectors for IE9 (' + stats.selectors.total + ') in ' + filepath);
			} else {
				gutil.log(gutil.colors.green('Selectors: ' + stats.selectors.total));
			}
		}));

});<commit_msg>changed file selector to scan all dist css files enhanced error exit code<commit_after>var gulp = require('gulp');
var tap = require('gulp-tap');
var gutil = require('gulp-util');
var cssstats = require('gulp-cssstats');
var config = require('./../config');


gulp.task('cssstats', function () {

	return gulp.src([
			config.global.dist + '/resources/css/**/*.css'
		])
		.pipe(cssstats())
		.pipe(tap(function (file) {
			var stats = JSON.parse(file.contents.toString());
			var filepath = file.path.substr(0, file.path.length - 4) + 'css';

			gutil.log(gutil.colors.blue('CSS Stats for ' + filepath));
			gutil.log(gutil.colors.green('Minified: ' + (stats.size / 1024).toFixed(2) + ' KB'));
			gutil.log(gutil.colors.green('Gzipped: ' + (stats.gzipSize / 1024).toFixed(2) + ' KB'));

			// IE9 selector limit
			if (stats.selectors.total > 40) {
				gutil.log(gutil.colors.red('Too much selectors for IE9 (' + stats.selectors.total + ' Selectors) in ' + filepath));
				process.exit(1);
			} else {
				gutil.log(gutil.colors.green('Selectors: ' + stats.selectors.total));
			}
		}));

});
{'fraction_non_alphanumeric': 0.1949032562529495, 'fraction_numerical': 0.01651722510618216, 'mean_word_length': 3.7533632286995515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2188533', 'n_tokens_mistral': 849, 'n_tokens_neox': 744, 'n_words': 141}