<commit_before>'use strict';

/**
 * Module dependencies.
 */

var through = require('through2');

var parseMatter = require('../utils/parse-matter');
var parsePath = require('../utils/parse-path');
var extendFile = require('../utils/extend-file');


module.exports = function initPlugin() {
  return through.obj(function (file, encoding, next) {
    if (file.isNull()) {
      this.push(file);
      return next();
    }
    file = parseMatter(file, encoding, next);
    file = parsePath(file, encoding, next);
    file = extendFile(file, encoding, next);
    this.push(file);
    next();
  });
};<commit_msg>ensure that options are passed to the init plugin<commit_after>'use strict';

/**
 * Module dependencies.
 */

var through = require('through2');
var _ = require('lodash');

var parseMatter = require('../utils/parse-matter');
var parsePath = require('../utils/parse-path');
var extendFile = require('../utils/extend-file');


module.exports = function initPlugin(options) {
  var opts = _.extend({}, this.options, options);

  return through.obj(function (file, encoding, next) {
    if (file.isNull()) {
      this.push(file);
      return next();
    }

    file = parseMatter(file, encoding, opts);
    file = parsePath(file, encoding, opts);
    file = extendFile(file, encoding, opts);

    this.push(file);
    next();
  });
};
{'fraction_non_alphanumeric': 0.1727475800446761, 'fraction_numerical': 0.0014892032762472078, 'mean_word_length': 3.6027397260273974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1505381', 'n_tokens_mistral': 413, 'n_tokens_neox': 404, 'n_words': 101}