Browse Source

Modify code format option

pull/6/head
Menci 6 years ago
parent
commit
81cfeedf7b
  1. 2
      libs/code_formatter.js

2
libs/code_formatter.js

@ -18,7 +18,7 @@ module.exports = async (code, lang) => {
await fs.writeFile(tempFile, code); await fs.writeFile(tempFile, code);
process = child_process.spawn(`${__dirname}/../bin/jcf`, [tempFile, '-inplace']); process = child_process.spawn(`${__dirname}/../bin/jcf`, [tempFile, '-inplace']);
} else { } else {
process = child_process.spawn(`clang-format -style="{BasedOnStyle: Google, IndentWidth: 4, AccessModifierOffset: -4, SortIncludes: false, AllowShortIfStatementsOnASingleLine: true, ColumnLimit: 110, Cpp11BracedListStyle: false }" -assume-filename="a.${lang}"`, { shell: true }); process = child_process.spawn(`clang-format -style="{BasedOnStyle: Google, IndentWidth: 4, AccessModifierOffset: -4, SortIncludes: false, AllowShortIfStatementsOnASingleLine: false, ColumnLimit: 110, Cpp11BracedListStyle: false }" -assume-filename="a.${lang}"`, { shell: true });
process.stdin.setEncoding('utf-8'); process.stdin.setEncoding('utf-8');
process.stdin.write(code); process.stdin.write(code);
process.stdin.end(); process.stdin.end();

Loading…
Cancel
Save