clang-format vs swift-format
clang-format
clang.llvm.orgswift-format
github.comSide by side
| Figure | clang-format | swift-format |
|---|---|---|
| Price from | — | Free |
| Free plan | — | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | — |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| iOS | — | Yes |
| Plans published | 0 | 1 |
| Spec score · Code formatters | 7.7 (#8) | 7.3 (#15) |
| Spec score · Code Formatting Tools | 7.6 (#20) | 7.4 (#27) |
| Configuration | Formatting styles can be set with command-line options or project-level .clang-format or _clang-format files. | Users can customize supported behavior with a JSON configuration file, and the tool searches parent directories for a .swift-format file. |
| License | LLVM releases are distributed under the Apache-2.0 license with LLVM exceptions, which the download page describes as OSI-approved. | The repository identifies its license as Apache-2.0. |
| Purpose | ClangFormat is a set of tools built on LibFormat for formatting source code, available as a standalone tool and through editor integrations. | swift-format provides formatting technology for Swift source code and building blocks for code formatting transformations. |
Plans
In their own words
clang-format
clang-format has no write-up on Specifiction yet; its figures are above.
swift-format
swift-format has no write-up on Specifiction yet; its figures are above.