tasks/lib/common.js
function(options, opt_fileList, opt_dirList) {

  var cmd = '';

  // Detect if the tool file is a python script. If so we need to
  // prefix the exec command with 'python'.
  if (stringEndsWith(options.toolFile, '.py')) {
    cmd += 'python ';
  }

  // Normalize the folder path and join the tool file.
  cmd += path.join(path.resolve(options.closureLinterPath), options.toolFile) + ' ';

  // Set command flags
  cmd += (options.strict) ? '--strict ' : '';
  cmd += (options.maxLineLength) ? '--max_line_length ' + options.maxLineLength + ' ' : '';

  // Finally add files to be linted
  if (opt_dirList && opt_dirList.length > 0) {
    cmd += opt_dirList.map(function(value) {return '-r ' + value;}).join(' ') + ' ';
  }

  if (opt_fileList && opt_fileList.length > 0) {
    cmd += opt_fileList.join(' ');
  }

  return cmd;
}
function(options, opt_fileList, opt_dirList) {

  var cmd = '';

  // Detect if the tool file is a python script. If so we need to
  // prefix the exec command with 'python'.
  if (stringEndsWith(options.toolFile, '.py')) {
    cmd += 'python ';
  }

  // Normalize the folder path and join the tool file.
  cmd += path.join(path.resolve(options.closureLinterPath), options.toolFile) + ' ';

  // Set command flags
  cmd += (options.strict) ? '--strict ' : '';
  cmd += (options.maxLineLength) ? '--max_line_length ' + options.maxLineLength + ' ' : '';

  // Finally add files to be linted
  if (opt_dirList && opt_dirList.length > 0) {
    cmd += opt_dirList.map(function(value) {return '-r ' + value;}).join(' ') + ' ';
  }

  if (opt_fileList && opt_fileList.length > 0) {
    cmd += opt_fileList.join(' ');
  }

  return cmd;
}
function ( options , opt_fileList , opt_dirList ) { var cmd = '' ; // Detect if the tool file is a python script. If so we need to // prefix the exec command with 'python'. if ( stringEndsWith ( options . toolFile , '.py' ) ) { cmd += 'python ' ; } // Normalize the folder path and join the tool file. cmd += path . join ( path . resolve ( options . closureLinterPath ) , options . toolFile ) + ' ' ; // Set command flags cmd += ( options . strict ) ? '--strict ' : '' ; cmd += ( options . maxLineLength ) ? '--max_line_length ' + options . maxLineLength + ' ' : '' ; // Finally add files to be linted if ( opt_dirList && opt_dirList . length > 0 ) { cmd += opt_dirList . map ( function ( value ) { return '-r ' + value ; } ) . join ( ' ' ) + ' ' ; } if ( opt_fileList && opt_fileList . length > 0 ) { cmd += opt_fileList . join ( ' ' ) ; } return cmd ; }
Create the linter command.
@param {object} options Grunt options.
@param {array=} opt_fileList List of source files to be linted.
@param {array=} opt_dirList List of directories to be linted.
Create the linter command .