<commit_before>/*
 * grunt-docpad-styleguide-keyval
 * https://github.com/jleonard/grunt-docpad-styleguide-keyval
 *
 * Copyright (c) 2013 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  // Please see the grunt documentation for more information regarding task
  // creation: https://github.com/gruntjs/grunt/blob/devel/docs/toc.md

  grunt.registerMultiTask('styleguide-keyval', 'Your task description goes here.', function() {

    var options = this.options({
      dest: ''
    });

    this.files.forEach(function(fileObj){
      var files = grunt.file.expand({nonull: true}, fileObj.src);
      var dest = options.dest;
      var src = files.map(function(filepath){
        if (!grunt.file.exists(filepath)) {
          
        }else{
          var file = grunt.file.read(filepath);
          file = removeComments(file);
          file = file.replace(/ /g,"").replace(/\t/g,"").replace(/\n/g,"");
          var arr = file.split(";");
          var len = arr.length;
          
          var html = "<table class='table table-condensed'>";
          for (var i = 0; i < len -1; i++) {
            var key_val = arr[i].split(":");
            grunt.log.write(key_val[0]);
            html += makeChip(key_val);
          }
          html += "</table>";
          grunt.file.write(dest,html);
        }
      });

    });

    function makeChip(arr){
      var val = arr[1];
      if(val.indexOf("@") == 0){
        return "";
      }
      var html = "<tr><td>"+arr[0]+"</td>";
      html += "<td>"+val+"</td></tr>";
      return html;
    }

    function removeComments(str) {
 
        var uid = '_' + +new Date(),
            primatives = [],
            primIndex = 0;
     
        return (
            str<commit_msg>skipping values starting with (<commit_after>/*
 * grunt-docpad-styleguide-keyval
 * https://github.com/jleonard/grunt-docpad-styleguide-keyval
 *
 * Copyright (c) 2013 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  // Please see the grunt documentation for more information regarding task
  // creation: https://github.com/gruntjs/grunt/blob/devel/docs/toc.md

  grunt.registerMultiTask('styleguide-keyval', 'Your task description goes here.', function() {

    var options = this.options({
      dest: ''
    });

    this.files.forEach(function(fileObj){
      var files = grunt.file.expand({nonull: true}, fileObj.src);
      var dest = options.dest;
      var src = files.map(function(filepath){
        if (!grunt.file.exists(filepath)) {
          
        }else{
          var file = grunt.file.read(filepath);
          file = removeComments(file);
          file = file.replace(/ /g,"").replace(/\t/g,"").replace(/\n/g,"");
          var arr = file.split(";");
          var len = arr.length;
          
          var html = "<table class='table table-condensed table-striped'>";
          for (var i = 0; i < len -1; i++) {
            var key_val = arr[i].split(":");
            grunt.log.write(key_val[0]);
            html += makeChip(key_val);
          }
          html += "</table>";
          grunt.file.write(dest,html);
        }
      });

    });

    function makeChip(arr){
      var val = arr[1];
      if(val.indexOf("@") == 0 || val.indexOf("(") == 0){
        return "";
      }
      var html = "<tr><td>"+arr[0]+"</td>";
      html += "<td>"+val+"</td></tr>";
      return html;
    }

    function removeComments(str) {
 
        var uid = '_' + +new Date(),
            primatives = [],
            primIndex = 0;
     
        return (
            str
{'fraction_non_alphanumeric': 0.16966012710693562, 'fraction_numerical': 0.0063553467808786955, 'mean_word_length': 1.9966887417218544, 'pattern_counts': {'":': 2, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 4, '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': '2330793', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1131, 'n_words': 238}