def check(codeString, filename, jshint_options): path = jshint_path() if os.path.exists(jsc_path): process = subprocess.Popen((jsc_path, os.path.join(path, 'jshint_jsc.js'), '--', str(codeString.count('\n')), jshint_options, path + os.path.sep), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=get_startupinfo()) else: process = subprocess.Popen(('node', os.path.join(path, 'jshint_node.js'), jshint_options), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=get_startupinfo()) result = process.communicate(codeString) if result: if process.returncode == 0: if result[0].startswith('jshint: '): print '{0}: {1}'.format(language, result[0][len('jshint: '):]) else: return json.loads(result[0].strip() or '[]') else: print '{0}: {1}'.format(language, result[0]) else: print '{0}: no result returned from jshint' return []
def check(codeString, filename): path = jshint_path() if os.path.exists(jsc_path): process = subprocess.Popen((jsc_path, os.path.join(path, 'jshint_jsc.js'), '--', str(codeString.count('\n')), '{}', path + os.path.sep), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=get_startupinfo()) else: process = subprocess.Popen(('node', os.path.join(path, 'jshint_node.js')), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=get_startupinfo()) result = process.communicate(codeString) if result: if process.returncode == 0: if result[0].startswith('jshint: '): print '{0}: {1}'.format(language, result[0][len('jshint: '):]) else: return json.loads(result[0].strip() or '[]') else: print '{0}: {1}'.format(language, result[0]) else: print '{0}: no result returned from jshint' return []
def is_enabled(): try: subprocess.Popen(('ruby', '-v'), startupinfo=get_startupinfo()) except OSError: return (False, 'ruby cannot be found') return True
def check(codeString, filename): process = subprocess.Popen(('ruby', '-wc'), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=get_startupinfo()) result = process.communicate(codeString)[0] return result
def check(codeString): global linter_executable process = subprocess.Popen((linter_executable, '-c'), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=get_startupinfo()) result = process.communicate(codeString)[0] return result
def is_enabled(): if os.path.exists(jsc_path): return (True, 'using JavaScriptCore') try: subprocess.call(['node', '-v'], startupinfo=get_startupinfo()) return (True, 'using node.js') except OSError: return (False, 'JavaScriptCore or node.js is required') except Exception as ex: return (False, unicode(ex))
def is_enabled(): global linter_executable linter_executable = get_executable('perl', 'perl') try: subprocess.Popen((linter_executable, '-v'), startupinfo=get_startupinfo(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate() except OSError: return (False, '"{0}" cannot be found'.format(linter_executable)) return (True, 'using "{0}" for executable'.format(linter_executable))
def check(codeString, args=[]): process = subprocess.Popen(('php', '-l', '-d display_errors=On'), stdin=subprocess.PIPE, stdout=subprocess.PIPE, startupinfo=get_startupinfo()) try: result = process.communicate(codeString)[0] except: result = '' return result
def check(codeString): global linter_executable process = subprocess.Popen((linter_executable, '-l', '-d display_errors=On'), stdin=subprocess.PIPE, stdout=subprocess.PIPE, startupinfo=get_startupinfo()) try: result = process.communicate(codeString)[0] except: result = '' return result