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 index.json of clang-tools-static-binaries, and each version installs the newest build that the index lists for it.
- 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. If something else has set the attribute, the plugin asks before removing it; setASDF_CLANG_TOOLS_MACOS_DEQUARANTINE=1to remove it without asking.
curl,jqsha512sumorshasum: checks each download against the SHA-512 that the index (or the release'sSHA512SUMSfile) gives for it. The install fails without one of them.
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.ASDF_CLANG_TOOLS_INDEX_URL: where to read the list of versions and files from. Defaults to theindex.jsonof clang-tools-static-binaries; set it to use a mirror. The plugin downloads the URL and checks the SHA-512 that the index gives for each file.GITHUB_TOKEN: only used if the index cannot be read, when the plugin falls back to listing the assets of the newest release through the GitHub API. If set, it 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.