<commit_before>/*jshint node: true, camelcase: false */


module.exports = function (grunt) {
	'use strict';

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-blanket-mocha');
	grunt.loadNpmTasks('grunt-mocha');
	grunt.loadTasks('build/tasks');

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		clean: ["dist"],
		watch: {
			files: ['test/**/*', 'lib/**/*'],
			tasks: ['fixture', 'build']
		},
		rules: {
			lib: {
				dest: {
					rules: 'dist/rules.js',
					checks: 'dist/checks.js'
				}
			}
		},
		uglify: {
			minify: {
				files: [{
					src: ['<%= rules.lib.dest.rules %>'],
					dest: 'dist/rules.min.js'
				}, {
					src: ['<%= rules.lib.dest.checks %>'],
					dest: 'dist/checks.min.js'
				}]
			},
			beautify: {
				files: [{
					src: ['<%= rules.lib.dest.rules %>'],
					dest: '<%= rules.lib.dest.rules %>'
				}, {
					src: ['<%= rules.lib.dest.checks %>'],
					dest: '<%= rules.lib.dest.checks %>'
				}],
				options: {
					mangle: false,
					compress: false,
					beautify: true
				}
			}
		},
		connect: {
			test: {
				options: {
					hostname: '0.0.0.0',
					port: 9876,
					base: ['.']
				}
			}
		},
		fixture: {
			checks: {
				src: '<%= rules.lib.dest.checks %>',
				dest: 'test/checks/index.html',
				options: {
					fixture: 'test/checks/runner.tmpl',
					testCwd: 'test/checks'
				}
			}
		},
		mocha: {
			test: {
				options: {
					urls: ['http://localhost:9876/test/checks'],
					reporter: 'XUnit',
					timeout: 10000,
					threshold: 90
				},
				dest: 'xunit.xml'
			}
		},
		blanket_mocha: {
			test: {
				options: {
					urls: ['http://localhost:9876/test/checks'],
					reporter: 'Spec',
					timeout: 10000,
					threshold: 90
				}
			}
		},
		jshint: {
			rules: {
				options: {
					jshintrc: true,
					reporter: grunt.option('report') ? require('jshint-junit-reporter') : undefined,
					reporterOutput: grunt.option('report') ? 'lint.xml' : undefined
				},
				src: ['lib/**/*.js', 'test/**/*.js', 'Gruntfile.js', '!test/mock/**/*.js']
			}
		}
	});

	grunt.registerTask('convert-check', function () {
		var files = grunt.file.expand(['lib/checks/**/*.json']);
		files.forEach(function (file) {
			var src = grunt.file.readJSON(file);
			src.type = src.result;
			delete src.result;
			grunt.file.write(file, JSON.stringify(src, null, '\t'));
		});
	});
	grunt.registerTask('server', ['fixture', 'connect:test:keepalive']);
	grunt.registerTask('test', ['build', 'fixture', 'connect:test', 'mocha']);
	grunt.registerTask('build', ['rules', 'uglify']);
	grunt.registerTask('default', ['build']);

};<commit_msg>Don't overwrite type if result doesn't exist<commit_after>/*jshint node: true, camelcase: false */


module.exports = function (grunt) {
	'use strict';

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-blanket-mocha');
	grunt.loadNpmTasks('grunt-mocha');
	grunt.loadTasks('build/tasks');

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		clean: ["dist"],
		watch: {
			files: ['test/**/*', 'lib/**/*'],
			tasks: ['fixture', 'build']
		},
		rules: {
			lib: {
				dest: {
					rules: 'dist/rules.js',
					checks: 'dist/checks.js'
				}
			}
		},
		uglify: {
			minify: {
				files: [{
					src: ['<%= rules.lib.dest.rules %>'],
					dest: 'dist/rules.min.js'
				}, {
					src: ['<%= rules.lib.dest.checks %>'],
					dest: 'dist/checks.min.js'
				}]
			},
			beautify: {
				files: [{
					src: ['<%= rules.lib.dest.rules %>'],
					dest: '<%= rules.lib.dest.rules %>'
				}, {
					src: ['<%= rules.lib.dest.checks %>'],
					dest: '<%= rules.lib.dest.checks %>'
				}],
				options: {
					mangle: false,
					compress: false,
					beautify: true
				}
			}
		},
		connect: {
			test: {
				options: {
					hostname: '0.0.0.0',
					port: 9876,
					base: ['.']
				}
			}
		},
		fixture: {
			checks: {
				src: '<%= rules.lib.dest.checks %>',
				dest: 'test/checks/index.html',
				options: {
					fixture: 'test/checks/runner.tmpl',
					testCwd: 'test/checks'
				}
			}
		},
		mocha: {
			test: {
				options: {
					urls: ['http://localhost:9876/test/checks'],
					reporter: 'XUnit',
					timeout: 10000,
					threshold: 90
				},
				dest: 'xunit.xml'
			}
		},
		blanket_mocha: {
			test: {
				options: {
					urls: ['http://localhost:9876/test/checks'],
					reporter: 'Spec',
					timeout: 10000,
					threshold: 90
				}
			}
		},
		jshint: {
			rules: {
				options: {
					jshintrc: true,
					reporter: grunt.option('report') ? require('jshint-junit-reporter') : undefined,
					reporterOutput: grunt.option('report') ? 'lint.xml' : undefined
				},
				src: ['lib/**/*.js', 'test/**/*.js', 'Gruntfile.js', '!test/mock/**/*.js']
			}
		}
	});

	grunt.registerTask('convert-check', function () {
		var files = grunt.file.expand(['lib/checks/**/*.json']);
		files.forEach(function (file) {
			var src = grunt.file.readJSON(file);
			if (src.result) {
				src.type = src.result;
				delete src.result;
			}
			grunt.file.write(file, JSON.stringify(src, null, '\t'));
		});
	});
	grunt.registerTask('server', ['fixture', 'connect:test:keepalive']);
	grunt.registerTask('test', ['build', 'fixture', 'connect:test', 'mocha']);
	grunt.registerTask('build', ['rules', 'uglify']);
	grunt.registerTask('default', ['build']);

};
{'fraction_non_alphanumeric': 0.2152427353401775, 'fraction_numerical': 0.01044022968505307, 'mean_word_length': 2.8268974700399467, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 2, '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': '7095188', 'n_tokens_mistral': 2804, 'n_tokens_neox': 2182, 'n_words': 324}