MCPcopy Index your code
hub / github.com/extrabacon/python-shell / checkSyntaxFile

Method checkSyntaxFile

index.ts:305–309  ·  view source on GitHub ↗

* checks syntax without executing code * @returns {Promise} rejects w/ stderr if syntax failure

(filePath: string)

Source from the content-addressed store, hash-verified

303 * @returns {Promise} rejects w/ stderr if syntax failure
304 */
305 static async checkSyntaxFile(filePath: string) {
306 const pythonPath = this.getPythonPath()
307 let compileCommand = `${pythonPath} -m py_compile ${filePath}`
308 return execPromise(compileCommand)
309 }
310
311 /**
312 * Runs a Python script and returns collected messages as a promise.

Callers 1

checkSyntaxMethod · 0.95

Calls 1

getPythonPathMethod · 0.95

Tested by

no test coverage detected