# Install clang-format with Homebrew, apt, dnf

Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript. Version 22.1.8 via Homebrew; verified 2026-06-16.

## Install

```sh
sudo av install brew:clang-format
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install clang-format
```

  Evidence: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install clang-format
```

  Evidence: Debian stable package indexes: clang-format from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install git-clang-format
```

  Evidence: Fedora Rawhide package metadata: git-clang-format from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

## Package facts

- **Package key:** brew:clang-format
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/clang-format>
- **Version:** 22.1.8
- **Source summary:** Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript
- **Homepage:** <https://clang.llvm.org/docs/ClangFormat.html>
- **Repository:** <https://github.com/llvm/llvm-project>
- **Upstream docs:** <https://clang.llvm.org/docs/ClangFormat.html>
- **License:** Apache-2.0 WITH LLVM-exception
- **Source archive:** <https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz>
- **Last updated:** 2026-06-16T19:45:28Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- clang-format (cli)
- git-clang-format (cli)
- clang-format (alias)
- git-clang-format (alias)

## Build dependencies

- cmake

## Uses from macOS

- python

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 22.1.8
- Package-manager updated: 2026-06-16
- Local data: ok
- Upstream repository: https://github.com/llvm/llvm-project
- info: No cached GitHub release or tag data was available.
## Project history and usage

clang-format is LLVM/Clang's source formatter and editor-integration tool for C-family and several adjacent languages. It became a standard package-manager dependency because teams can install one CLI and enforce formatting locally, in editors, in Git workflows, and in CI.

### Project history

LLVM's Clang 3.3 documentation already described ClangFormat as tools built on LibFormat, with a standalone clang-format binary under clang/tools/clang-format. Later documentation expanded language coverage, configuration files, ignore files, and editor integrations.

### Adoption history

The supplied package-manager data shows Homebrew, Debian, Fedora/DNF, and Ubuntu packaging. Its adoption is reinforced by direct editor integration in Vim, Emacs, BBEdit, CLion, Visual Studio, and similar tooling documented by LLVM.

### How it is used

Users run clang-format over files or standard input, often with -i for in-place edits. Project style is commonly stored in .clang-format or _clang-format, generated with -dump-config, and found by using -style=file.

### Why package nerds care

clang-format is significant because it decouples source formatting policy from any one IDE. Package managers provide a pinned binary that projects can call from hooks, CI jobs, editor plugins, and language-server-style workflows, making formatting reproducible across operating systems.

### Timeline

- 2013: Clang 3.3 documentation included clang-format for C/C++/Obj-C.
- 2014: Clang 3.4 documentation documented multi-file formatting and dump-config support.
- 2020: LLVM 11 release notes continued adding clang-format style options such as IndentExternBlock.
- 2026: Current LLVM documentation lists broader language support including Java, JavaScript, JSON, TypeScript, C#, Protobuf, and Objective-C.

### Related projects

- Related projects include LLVM, Clang, LibFormat, git-clang-format, clang-format editor plugins, clangd, and language-specific formatters such as gofmt, rustfmt, black, and prettier.

### Sources

- <https://clang.llvm.org/docs/ClangFormat.html>
- <https://github.com/llvm/llvm-project>
- <https://releases.llvm.org/3.3/tools/clang/docs/ClangFormat.html>
- <https://releases.llvm.org/3.4/tools/clang/docs/ClangFormat.html>
- <https://releases.llvm.org/11.1.0/tools/clang/docs/ReleaseNotes.html>


## Security Notes

No matching local secret-handling manifest was found for clang-format. Nucleus package metadata is still published here so future coverage has a stable package URL.



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .clang-format, _clang-format
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** clang-format
- **Aliases:** clang-format@22
- **Version Scheme:** 1
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - clang-format - 1:19.0-63: normalized package name match | Debian stable package indexes: clang-format from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tool to format C/C++/Obj-C code
- Ubuntu apt - clang-format - 1:18.0-59~exp2: normalized package name match | Ubuntu 24.04 LTS package indexes: clang-format from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Tool to format C/C++/Obj-C code
- dnf - git-clang-format - 22.1.7-1.fc45: installed executable or alias match | Fedora Rawhide package metadata: git-clang-format from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Integration of clang-format for git | http://llvm.org


## Related links

- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Documentation packages](https://www.automicvault.com/pkg/documentation-tools/) - Matched documentation, manual, or publishing metadata.
- [Web development packages](https://www.automicvault.com/pkg/web-dev-tools/) - Matched web development metadata.
- [cmake](https://www.automicvault.com/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [clang-format@11](https://www.automicvault.com/pkg/brew/clang-format-11/) - Package name indicates the same formula family.
- [flang](https://www.automicvault.com/pkg/brew/flang/) - Shares the same upstream source repository.
- [lld](https://www.automicvault.com/pkg/brew/lld/) - Shares the same upstream source repository.
- [clang-format](https://www.automicvault.com/pkg/npm/clang-format/) - Same normalized package name appears in another local ecosystem. Shared terms: clang, clang-format, format, git, git-clang-format.
- [clang-build-analyzer](https://www.automicvault.com/pkg/brew/clang-build-analyzer/) - Package names and metadata indicate a similar tool family. Shared terms: clang.
- [clang-format](https://www.automicvault.com/pkg/npm/clang-format/) - Same normalized package name in another local ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/clang-format.yml](https://github.com/automic-vault/db/blob/main/combined/clang-format.yml)


## Sources

- Nucleus package database
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
