<commit_before>var gulp = require('gulp');
var metlsmithPrism = require('metalsmith-prism');
var metalsmithMock = require('metalsmith-mock');
var frontMatter = require('gulp-front-matter');
var _ = require('lodash');
var fs = require('fs');
var gulpsmith = require('gulpsmith');
var templates = require('metalsmith-templates');
var collections = require('metalsmith-collections');
var metalsmithPaths = require('metalsmith-path');
var filter = require('gulp-filter');
var gulpif = require('gulp-if');
var rename = require('gulp-rename');
var using = require('gulp-using');
var moment = require('moment');
var browserSync = require('browser-sync');
var reload = browserSync.reload;

var config = require('../config');
var Sort = require('../utils/metalsmith.title.sorting');
var handlebarsPaths = require('../utils/handlebars.paths');
var handlebarsPartials = require('../utils/handlebars.partials');

var Handlebars = require('handlebars');

gulp.task('build', ['build:handlebars:partials', 'build:docs']);

gulp.task('build:handlebars:partials', function() {

  Handlebars.registerHelper('base', handlebarsPaths);
  var partials = handlebarsPartials(config.docs.partials.src);

  _.each(partials, function(path, name) {
    Handlebars.registerPartial(name, fs.readFileSync(path, 'utf8'));
  });

  Handlebars.registerHelper('is', function(a, b, opts) {
    if(a === b) {
      return opts.fn(this);
    } else {
      return opts.inverse(this);
    }
  });

  Handlebars.registerHelper('date', function() {
    return moment().format('YYYY');
  });

  // http://funkjedi.com/technology/412-every-nth-item-in-handlebars/
  Handlebars.registerHelper('grouped_each', function(every, context, options) {
    var out = "", subcontext = [], i;
    if(context && context.length > 0) {
      for(i = 0; i < context.length; i++) {
        if(i > 0 && i % every === 0) {
            out += options.fn(subcontext);
            subcontext = [];
        }
        subcontext.push(context[i]);
      }
      out += options.fn(subcontext);
    }
    return out;
  });

});
<commit_msg>linter fixes<commit_after>var gulp = require('gulp');
var metlsmithPrism = require('metalsmith-prism');
var metalsmithMock = require('metalsmith-mock');
var frontMatter = require('gulp-front-matter');
var _ = require('lodash');
var fs = require('fs');
var gulpsmith = require('gulpsmith');
var templates = require('metalsmith-templates');
var collections = require('metalsmith-collections');
var metalsmithPaths = require('metalsmith-path');
var filter = require('gulp-filter');
var gulpif = require('gulp-if');
var rename = require('gulp-rename');
var using = require('gulp-using');
var moment = require('moment');
var browserSync = require('browser-sync');
var reload = browserSync.reload;

var config = require('../config');
var Sort = require('../utils/metalsmith.title.sorting');
var handlebarsPaths = require('../utils/handlebars.paths');
var handlebarsPartials = require('../utils/handlebars.partials');

var Handlebars = require('handlebars');

gulp.task('build', ['build:handlebars:partials', 'build:docs']);

gulp.task('build:handlebars:partials', function() {

  Handlebars.registerHelper('base', handlebarsPaths);
  var partials = handlebarsPartials(config.docs.partials.src);

  _.each(partials, function(path, name) {
    Handlebars.registerPartial(name, fs.readFileSync(path, 'utf8'));
  });

  Handlebars.registerHelper('is', function(a, b, opts) {
    if(a === b) {
      return opts.fn(this);
    } else {
      return opts.inverse(this);
    }
  });

  Handlebars.registerHelper('date', function() {
    return moment().format('YYYY');
  });

  // http://funkjedi.com/technology/412-every-nth-item-in-handlebars/
  Handlebars.registerHelper('grouped_each', function(every, context, options) {
    var out = '';
    var subcontext = [];
    var i;
    if(context && context.length > 0) {
      for(i = 0; i < context.length; i++) {
        if(i > 0 && i % every === 0) {
          out += options.fn(subcontext);
          subcontext = [];
        }
        subcontext.push(context[i]);
      }
      out += options.fn(subcontext);
    }
    return out;
  });

});

{'fraction_non_alphanumeric': 0.1762581266554298, 'fraction_numerical': 0.003852636648206116, 'mean_word_length': 4.153846153846154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6157924', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1296, 'n_words': 255}