def _lint_js_files(node_path, jscs_path, config_jscsrc, files_to_lint, stdout, result):
 start_time = time.time()
 num_files_with_errors = 0
 num_js_files = len(files_to_lint)
 if (not files_to_lint):
  result.put('')
  print 'There are no JavaScript files to lint.'
  return
 print 'Total js files: ', num_js_files
 jscs_cmd_args = [node_path, jscs_path, config_jscsrc]
 for (_, filename) in enumerate(files_to_lint):
  print 'Linting: ', filename
  proc_args = (jscs_cmd_args + [filename])
  proc = subprocess.Popen(proc_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  (linter_stdout, linter_stderr) = proc.communicate()
  if linter_stderr:
   print 'LINTER FAILED'
   print linter_stderr
   sys.exit(1)
  if linter_stdout:
   num_files_with_errors += 1
   stdout.put(linter_stdout)
 if num_files_with_errors:
  result.put(('%s    %s JavaScript files' % (_MESSAGE_TYPE_FAILED, num_files_with_errors)))
 else:
  result.put(('%s   %s JavaScript files linted (%.1f secs)' % (_MESSAGE_TYPE_SUCCESS, num_js_files, (time.time() - start_time))))
 print 'Js linting finished.'

def _lint_js_files ( node_path , jscs_path , config_jscsrc , files_to_lint , stdout , result ) : start_time = time . time ( ) num_files_with_errors = 0 num_js_files = len ( files_to_lint ) if ( not files_to_lint ) : result . put ( '' ) print 'There are no JavaScript files to lint.' return print 'Total js files: ' , num_js_files jscs_cmd_args = [ node_path , jscs_path , config_jscsrc ] for ( _ , filename ) in enumerate ( files_to_lint ) : print 'Linting: ' , filename proc_args = ( jscs_cmd_args + [ filename ] ) proc = subprocess . Popen ( proc_args , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) ( linter_stdout , linter_stderr ) = proc . communicate ( ) if linter_stderr : print 'LINTER FAILED' print linter_stderr sys . exit ( 1 ) if linter_stdout : num_files_with_errors += 1 stdout . put ( linter_stdout ) if num_files_with_errors : result . put ( ( '%s    %s JavaScript files' % ( _MESSAGE_TYPE_FAILED , num_files_with_errors ) ) ) else : result . put ( ( '%s   %s JavaScript files linted (%.1f secs)' % ( _MESSAGE_TYPE_SUCCESS , num_js_files , ( time . time ( ) - start_time ) ) ) ) print 'Js linting finished.'
prints a list of lint errors in the given list of javascript files .