// bash format
// shfmt -l -w script.sh
import { format as _formatSql } from 'sql-formatter';
import decodeUtf8 from 'decode-utf8';
import { getCommand } from '../../../../code/tool/shared/command.js';
export function buildCommandToFormatCodeWithClangFormat(input) {
    const cmd = getCommand(`clang-format`);
    cmd.link.push(`--style="${input.style}"`, `"${input.input.file.path}"`);
    return [cmd];
}
// https://github.com/sql-formatter-org/sql-formatter?tab=readme-ov-file
export function formatSqlWithContent(input) {
    const text = input.input.file.content instanceof ArrayBuffer
        ? decodeUtf8(input.input.file.content)
        : input.input.file.content;
    return _formatSql(text);
}
// objdump disassembly
export function buildCommandToFormatKotlin(input) {
    const cmd = getCommand('ktfmt');
    cmd.link.push(input.input.file.path);
    return cmd;
}
export function buildCommandToFormatSwift(input) {
    const cmd = getCommand('swift-format');
    cmd.link.push(input.input.file.path);
    return cmd;
}
export function buildCommandToFormatRust(input) {
    const cmd = getCommand('rustfmt');
    cmd.link.push(input.input.file.path);
    return [cmd];
}
export function buildCommandToFormatPython(input) {
    const cmd = getCommand('black');
    cmd.link.push(input.input.file.path);
    return cmd;
}
export function buildCommandToFormatRuby(input) {
    const cmd = getCommand('rubocop');
    cmd.link.push(input.input.file.path);
    return cmd;
}
export function buildCommandToFormatAssembly(input) {
    const cmd = getCommand('asmfmt');
    cmd.link.push(input.input.file.path);
    return cmd;
}
// rubocop --autocorrect file.rb
// antlr4-parse Expr.g4 prog -tree
// perltidy somefile.pl
// latexindent.pl.
// https://github.com/Koihik/LuaFormatter
// https://github.com/pseewald/fprettify
// https://github.com/thomasrussellmurphy/istyle-verilog-formatter
//# sourceMappingURL=command.js.map