<commit_before>/*jshint camelcase:false */

var cHelpers = require('./helpers'),
    gruntMod = require('grunt');

// path to builder from closure lib path
var BUILDER = '/closure/bin/build/closurebuilder.py';

// the object we'll export.
var builder = {};

/**
 * Perform validations for given options
 *
 * @return {boolean} false if error
 */
builder.validate = function ( options )
{
  // check for closure lib path
  var libPath = options.closureLibraryPath;

  var builder;
  if (!libPath) {
    // check for direct assignment of builder script
    builder = options.builder;
    if (!builder) {
      cHelpers.log.error('closureLibraryPath'.red + ' or ' + 'builder'.red + ' properties are required');
      return false;
    }
  } else {
    builder = libPath + BUILDER;
  }

  builder = gruntMod.template.process(builder);

  // ---
  // validate builder existence
  // ---
  if (!gruntMod.file.isFile( builder )) {
    cHelpers.log.error('builder file/path not valid: ' + builder.red);
    return false;
  }

  // ---
  // Check for inputs or paths
  // ---
  var inputs = options.inputs;
  var namespaces = options.namespaces;
  if (0 === inputs.length && !namespaces) {
    cHelpers.log.error('src'.red + ' or ' + 'namespaces'.red +
      ' properties are required');<commit_msg>fixed bug where task broke if no inputs are defined<commit_after>/*jshint camelcase:false */

var cHelpers = require('./helpers'),
    gruntMod = require('grunt');

// path to builder from closure lib path
var BUILDER = '/closure/bin/build/closurebuilder.py';

// the object we'll export.
var builder = {};

/**
 * Perform validations for given options
 *
 * @return {boolean} false if error
 */
builder.validate = function ( options )
{
  // check for closure lib path
  var libPath = options.closureLibraryPath;

  var builder;
  if (!libPath) {
    // check for direct assignment of builder script
    builder = options.builder;
    if (!builder) {
      cHelpers.log.error('closureLibraryPath'.red + ' or ' + 'builder'.red + ' properties are required');
      return false;
    }
  } else {
    builder = libPath + BUILDER;
  }

  builder = gruntMod.template.process(builder);

  // ---
  // validate builder existence
  // ---
  if (!gruntMod.file.isFile( builder )) {
    cHelpers.log.error('builder file/path not valid: ' + builder.red);
    return false;
  }

  // ---
  // Check for inputs or paths
  // ---
  var inputs = options.inputs || [];
  var namespaces = options.namespaces;
  if (0 === inputs.length && !namespaces) {
    cHelpers.log.error('src'.red + ' or ' + 'namespaces'.red +
      ' properties are required');
{'fraction_non_alphanumeric': 0.14405487804878048, 'fraction_numerical': 0.0007621951219512195, 'mean_word_length': 2.837719298245614, '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': '5539117', 'n_tokens_mistral': 795, 'n_tokens_neox': 792, 'n_words': 222}