[
{
"name": "clang-format",
"exts": ["c", "h", "cpp", "hpp", "cc", "cxx"],
"binary": "clang-format",
"standalone": false,
"toolchain": "LLVM / Clang",
"args": ["-style=file", "-fallback-style=none", "-i", "$filepath"]
},
{
"name": "dotnet-format",
"exts": ["cs"],
"binary": "dotnet",
"standalone": false,
"toolchain": ".NET SDK",
"args": ["format", "$filepath"]
},
{
"name": "gofmt",
"exts": ["go"],
"binary": "gofmt",
"standalone": false,
"toolchain": "Go toolchain",
"args": ["-w", "$filepath"]
},
{
"name": "rustfmt",
"exts": ["rs"],
"binary": "cargo",
"standalone": false,
"toolchain": "Rust toolchain",
"args": ["fmt", "--", "$filepath"]
},
{
"name": "black",
"exts": ["py"],
"binary": "black",
"standalone": false,
"toolchain": "Python (pip package)",
"args": ["$filepath"]
},
{
"name": "google-java-format",
"exts": ["java"],
"binary": "google-java-format",
"standalone": true,
"args": ["-i", "$filepath"],
"downloads": {
"linux-amd64": "https://github.com/google/google-java-format/releases/latest/download/google-java-format_linux-x86_64",
"windows-amd64": "https://github.com/google/google-java-format/releases/latest/download/google-java-format_windows-x86_64.exe",
"macos-amd64": "https://github.com/google/google-java-format/releases/latest/download/google-java-format_osx-x86_64"
}
},
{
"name": "prettier",
"exts": ["js", "jsx", "ts", "tsx", "json", "css", "html"],
"binary": "prettier",
"standalone": false,
"toolchain": "Node.js (npm package)",
"args": ["--write", "$filepath"]
},
{
"name": "shfmt",
"exts": ["sh", "bash"],
"binary": "shfmt",
"standalone": true,
"args": ["-w", "$filepath"],
"downloads": {
"linux-amd64": "https://github.com/mvdan/sh/releases/latest/download/shfmt_linux_amd64",
"windows-amd64": "https://github.com/mvdan/sh/releases/latest/download/shfmt_windows_amd64.exe",
"macos-amd64": "https://github.com/mvdan/sh/releases/latest/download/shfmt_darwin_amd64"
}
},
{
"name": "ktlint",
"exts": ["kt", "kts"],
"binary": "ktlint",
"standalone": true,
"args": ["-F", "$filepath"],
"downloads": {
"linux-amd64": "https://github.com/pinterest/ktlint/releases/latest/download/ktlint",
"windows-amd64": "https://github.com/pinterest/ktlint/releases/latest/download/ktlint.exe",
"macos-amd64": "https://github.com/pinterest/ktlint/releases/latest/download/ktlint"
}
},
{
"name": "dart format",
"exts": ["dart"],
"binary": "dart",
"standalone": false,
"toolchain": "Dart SDK",
"args": ["format", "$filepath"]
},
{
"name": "swift-format",
"exts": ["swift"],
"binary": "swift-format",
"standalone": true,
"args": ["-i", "$filepath"],
"downloads": {
"linux-amd64": "https://github.com/apple/swift-format/releases/latest/download/swift-format-linux",
"macos-amd64": "https://github.com/apple/swift-format/releases/latest/download/swift-format-macos"
}
},
{
"name": "cmake-format",
"exts": ["cmake"],
"binary": "cmake-format",
"standalone": false,
"toolchain": "Python (pip package)",
"args": ["-i", "$filepath"]
}
]
We have a POC, that calls clang-format. Lets make this extendable. Lets have the formaters in a config file. This could be updated independently of the IDE. Code for formatting now sits on the project manager, but could be moved to a new plugin.
Further updates: