MCPcopy Create free account
hub / github.com/nodejs/node / CppLintWorker

Function CppLintWorker

deps/v8/tools/v8_presubmit.py:96–124  ·  view source on GitHub ↗
(command)

Source from the content-addressed store, hash-verified

94
95
96def CppLintWorker(command):
97 try:
98 process = subprocess.Popen(command, stderr=subprocess.PIPE)
99 process.wait()
100 out_lines = ""
101 error_count = -1
102 while True:
103 out_line = decode(process.stderr.readline())
104 if out_line == '' and process.poll() is not None:
105 if error_count == -1:
106 print("Failed to process %s" % command.pop())
107 return 1
108 break
109 if out_line.strip() == 'Total errors found: 0':
110 out_lines += "Done processing %s\n" % command.pop()
111 error_count += 1
112 else:
113 m = LINT_OUTPUT_PATTERN.match(out_line)
114 if m:
115 out_lines += out_line
116 error_count += 1
117 sys.stdout.write(out_lines)
118 return error_count
119 except KeyboardInterrupt:
120 process.kill()
121 except:
122 print('Error running cpplint.py. Please make sure you have depot_tools' +
123 ' in your third_party directory. Lint check skipped.')
124 process.kill()
125
126def ClangFormatWorker(command):
127 try:

Callers

nothing calls this directly

Calls 7

popMethod · 0.80
killMethod · 0.80
decodeFunction · 0.70
printFunction · 0.70
matchMethod · 0.65
waitMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected