MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / format

Function format

lib/formatters/base.ts:42–45  ·  view source on GitHub ↗

* Format the provided source code using the formatting tool. * * This method should construct the command line arguments and call the formatter executable with the constructed * arguments, returning the execution result

(source: string, options: FormatOptions)

Source from the content-addressed store, hash-verified

40 * arguments, returning the execution result
41 */
42 async format(source: string, options: FormatOptions): Promise<UnprocessedExecResult> {
43 const args = [`--style=${options.baseStyle}`];
44 return await exec.execute(this.formatterInfo.exe, args, {input: source});
45 }
46
47 /**
48 * Test if a formatting base style is valid for this formatter

Callers

nothing calls this directly

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected