Skip to content

PolyCam/clang-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clang-tools

Pinned, cross-platform clang tooling — clang-format, clang-tidy, clang-apply-replacements, clang-query — distributed as npm packages and as standalone binaries, so a whole team and CI run exactly the same tools with no per-machine install drift, no Python, and no custom Homebrew tap. The tool set is declared in scripts/tools.mjs.

The version is the LLVM version. @polycam/clang-tools@22.1.8 gives you clang-format and clang-tidy from LLVM 22.1.8, everywhere.

yarn add -D @polycam/clang-tools@22.1.8
npx clang-format --version   # clang-format version 22.1.8
npx clang-tidy   --version   # LLVM version 22.1.8

Why

LLVM publishes no standalone per-tool binaries — only a ~1.5 GB full-toolchain tarball. Existing repackagers each fall short for a C++ shop that needs both tools pinned to one version: clang-format-node is format-only, the PyPI wheels drag in a Python toolchain, and the community static-binary projects lag several LLVM releases behind (so no --experimental-custom-checks for query-based custom clang-tidy checks). This repo repackages LLVM's own official release binaries into per-platform npm packages and raw GitHub-release artifacts, on a version we control.

How it's built

The release workflow downloads the official LLVM-<version>-<platform>.tar.xz, extracts the tools in scripts/tools.mjs plus clang's builtin-header resource dir (lib/clang/<major>/include) for the ones that parse C++, and packages them. No compilation — these are LLVM's own binaries, which run standalone on their target OS. The resource dir ships beside the binaries, so clang-tidy/clang-query need no -resource-dir wrangling.

Distribution

  • npm — a meta package (@polycam/clang-tools) with os/cpu-scoped optionalDependencies, so installs pull only the host's binaries. See npm/clang-tools/README.md for the API.
  • GitHub releases — every release attaches the standalone binaries with .sha512 checksums, for curl-based consumers.

Supported platforms

macOS arm64, Linux x86-64, Windows x86-64.

Releasing

See RELEASING.md. In short: run the Release workflow and give it an LLVM version.

License

MIT. The clang-format/clang-tidy binaries are redistributed from the LLVM Project under the Apache-2.0-with-LLVM-exception license.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors