<commit_before>/*!
 * gulp-prettify <https://github.com/jonschlinkert/gulp-prettify>
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var through = require('through2');
var prettify = require('js-beautify').html;
var gutil = require('gulp-util');
var _ = require('lodash');

module.exports = function (options) {
  options = options || {};

  return through.obj(function (file, encoding, callback) {
    try {

      var str = file.contents.toString(encoding || 'utf8');

      file.contents = new Buffer(prettify(str, _.extend({
        indent_handlebars: true,
        indent_inner_html: true,
        preserve_newlines: false,
        max_preserve_newlines: 1,
        brace_style: 'expand',
        indent_char: ' ',
        indent_size: 2,
      }, options)));

    } catch (err) {
      return callback(new gutil.PluginError('gulp-prettify', err, options));
    }

    callback(null, file);
  });
};<commit_msg>clean up<commit_after>/*!
 * gulp-prettify <https://github.com/jonschlinkert/gulp-prettify>
 *
 * Copyright (c) 2014-2015 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var through = require('through2');
var extend = require('extend-shallow');
var prettify = require('js-beautify').html;

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

  return through.obj(function(file, enc, next) {
    if (file.isNull()) {
      next();
      return;
    }

    try {
      var str = file.contents.toString();
      file.contents = new Buffer(prettify(str, extend({
        indent_handlebars: true,
        indent_inner_html: true,
        preserve_newlines: false,
        max_preserve_newlines: 1,
        brace_style: 'expand',
        indent_char: ' ',
        indent_size: 2
      }, opts)));

    } catch (err) {
      next(err);
      return;
    }

    next(null, file);
  });
};
{'fraction_non_alphanumeric': 0.149812734082397, 'fraction_numerical': 0.010165864098448368, 'mean_word_length': 2.8877338877338876, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4053029', 'n_tokens_mistral': 626, 'n_tokens_neox': 598, 'n_words': 133}