An asdf plugin that installs clang-format, clang-tidy and other LLVM tools from the cpp-linter static binaries, without building LLVM.
Website · Get started · Discussions
With asdf 0.16 or later:
# Add the plugin
asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git
# Show all installable versions
asdf list all clang-format
# Install the latest version
asdf install clang-format latest
# Set a version (writes .tool-versions in the current directory; -u writes ~/.tool-versions)
asdf set clang-format latest
# Now clang-format is available
clang-format --versionCheck asdf readme for more instructions on how to install & manage versions.
Each tool is a separate plugin. Add it by URL, with the tool name as the plugin name:
| Tool | Command to add Plugin |
|---|---|
| clang-format | asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git |
| clang-query | asdf plugin add clang-query https://github.com/cpp-linter/asdf-clang-tools.git |
| clang-tidy | asdf plugin add clang-tidy https://github.com/cpp-linter/asdf-clang-tools.git |
| clang-apply-replacements | asdf plugin add clang-apply-replacements https://github.com/cpp-linter/asdf-clang-tools.git |
| clang-include-cleaner | asdf plugin add clang-include-cleaner https://github.com/cpp-linter/asdf-clang-tools.git |
Clang versions 12 through 23 are supported. clang-include-cleaner is only available from version 18 onward.
Versions are major versions (21, not 21.1.0). asdf list all <tool> shows the versions in the latest clang-tools-static-binaries release.
- Pre-compiled binaries are provided for:
- Linux:
amd64(x86_64),arm64(aarch64) - macOS:
amd64(Intel),arm64(Apple Silicon)
- Linux:
- The macOS binaries are ad-hoc signed, not notarized. The plugin downloads them with
curl, which does not set the quarantine attribute, so they run without a Gatekeeper prompt.
curl,jqsha512sumorshasum(optional, but recommended): checks each download against the release'sSHA512SUMSfile
ASDF_CLANG_TOOLS_LINUX_IGNORE_ARCH: set to "1" to install theamd64binary regardless of the host architecture. This can be useful if you have set up QEMU User Emulation (or similar) to run foreign binaries under emulation. Normally, the nativearm64/aarch64Linux binaries are used automatically when detected.GITHUB_TOKEN: if set, the plugin sends it with the GitHub API request that lists the release's assets, which avoids the lower rate limit for unauthenticated requests (for example in CI).
See the contributing guide and open an issue for bugs and feature requests.
This project is licensed under the MIT License.