<commit_before>/*global module:false*/
module.exports = function(grunt) {

  // External libs.
  var Mocha = require('mocha');
  var path = require("path");
  var rimraf = require("rimraf");
  var async = require("async");
  var exec = require("child_process").exec;

  // Project configuration.
  grunt.initConfig({

    lint: {
      files: ['grunt.js', 'lib/**/*.js']
    },

    mocha: {
      testdir: 'build/'
    },

    watch: {
      files: ['<config:build.test.src>', '<config:build.main.src>'],
      tasks: 'test'
    },

    clean: {
      all: 'build'
    },

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        boss: true,
        eqnull: true
      },
      globals: {}
    },

    build: {
      main: {
        src: "src/*.js",
        dest: "lib/"
      },
      test: {
        src: "test/*.js",
        dest: "build/"
      }
    }
  });

  // Default task.
  grunt.registerTask('default', 'clean test');

  grunt.registerTask('test', 'build mocha');


  grunt.registerMultiTask('build', "Compile the src and tests",  function() {
    var done = this.async();

    var files = grunt.file.expandFiles(this.file.src);
    var outpath = this.file.dest;
    var processed = 0;

    grunt.file.mkdir(outpath);

    files.forEach(function(file) {
      var cmd = "bin/sjs --output " + outpath + path.basename(file) + " " + file;

      grunt.log.writeln("compiling " + file);

      exec(cmd, function(error, out, err) {
        if(error) {
          grunt.log.error(error);
        } 

        grunt.log.write(out);
        processed += 1;
        if(processed >= files.length) {
          grunt.log.ok("done");
          done();
        }
      });
    });
  });


  grunt.registerHelper('run_mocha', function(testdir, done) {
    console.log(testdir)
    exec("mocha --growl " + testdir, function(error, out, err) {
      if(error) {
        console.log(error);
      }
      console.log(out);
      done(true);
    });
  });<commit_msg>more cleaning<commit_after>/*global module:false*/
module.exports = function(grunt) {

  // External libs.
  var Mocha = require('mocha');
  var path = require("path");
  var rimraf = require("rimraf");
  var async = require("async");
  var exec = require("child_process").exec;

  // Project configuration.
  grunt.initConfig({

    lint: {
      files: ['grunt.js', 'lib/**/*.js']
    },

    mocha: {
      testdir: 'build/'
    },

    watch: {
      files: ['<config:build.test.src>', '<config:build.main.src>'],
      tasks: 'test'
    },

    clean: {
      all: 'build'
    },

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        boss: true,
        eqnull: true
      },
      globals: {}
    },

    build: {
      main: {
        src: "src/*.js",
        dest: "lib/"
      },
      test: {
        src: "test/*.js",
        dest: "build/"
      }
    }
  });

  // Default task.
  grunt.registerTask('default', 'clean test');

  grunt.registerTask('test', 'build mocha');


  grunt.registerMultiTask('build', "Compile the src and tests",  function() {
    var done = this.async();

    var files = grunt.file.expandFiles(this.file.src);
    var outpath = this.file.dest;
    var processed = 0;

    grunt.file.mkdir(outpath);

    files.forEach(function(file) {
      var cmd = "bin/sjs --output " + outpath + path.basename(file) + " " + file;

      grunt.log.writeln("compiling " + file);

      exec(cmd, function(error, out, err) {
        if(error) {
          grunt.log.error(error);
        } 

        grunt.log.write(out);
        processed += 1;
        if(processed >= files.length) {
          grunt.log.ok("done");
          done();
        }
      });
    });
  });


  grunt.registerHelper('run_mocha', function(testdir, done) {
    exec("mocha --growl " + testdir, function(error, out, err) {
      if(error) {
        grunt.log.error(err);
        done(false);
        return;
      }
      grunt.log.ok(out);
      done(true);
    });
  });
{'fraction_non_alphanumeric': 0.16961547534795943, 'fraction_numerical': 0.0009436187780136825, 'mean_word_length': 1.9001367989056088, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6353912', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1416, 'n_words': 280}