Automic VaultAutomic Vault

brew

使用 Homebrew, apt, dnf 安装 clang-format

查看 clang-format 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install clang-format

local Homebrew formula metadata

Linux

Debian apt已验证 · 92%
sudo apt install clang-format

Debian stable package indexes · clang-format · 来源: deb.debian.org

Fedora dnf已验证 · 92%
sudo dnf install git-clang-format

Fedora Rawhide package metadata · git-clang-format · 来源: dl.fedoraproject.org

概览

软件包摘要

Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript

命令和别名

  • clang-format
  • git-clang-format

历史

项目历史与用法

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.

项目历史

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.

采用历史

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.

使用方式

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.

为什么软件包爱好者会关心

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.

时间线

  • 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.

安全态势

尚未找到受保护工具覆盖

没有找到 clang-format 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布,以便未来覆盖拥有稳定的软件包 URL。

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 6 个平台目标。
  • 构建元数据列出 1 个构建依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

local files

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

Config paths the tool may read or write during local use.

Unix
.clang-format_clang-format

可执行文件

已安装的可执行文件

命令类型暴露范围备注
clang-formatcli全局可执行文件
git-clang-formatcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-10
管理器版本22.1.8
管理器更新时间2026-06-16
本地数据OK
上游not checked
检测到的最新版本未检测到

https://github.com/llvm/llvm-project

安装元数据

软件包元数据

软件包键brew:clang-format
版本22.1.8
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/clang-format
主页https://clang.llvm.org/docs/ClangFormat.html
仓库https://github.com/llvm/llvm-project
上游文档https://clang.llvm.org/docs/ClangFormat.html
许可证Apache-2.0 WITH LLVM-exception
源码归档https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz
最后更新2026-06-16T19:45:28Z
Pulseupdated
构建依赖cmake
macOS 提供的库python
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Nameclang-format
Aliases
  • clang-format@22
Version Scheme1
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Debian apt95%

clang-format 1:19.0-63

Tool to format C/C++/Obj-C code

sudo apt install clang-format
  • Section: devel
  • Architecture: amd64
  • Source Package: llvm-defaults
  • 1 依赖
  • normalized package name match
  • 匹配方式:Clang Format
Debian stable package indexes · deb.debian.org · Debian stable package indexes: clang-format from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Ubuntu apt95%

clang-format 1:18.0-59~exp2

Tool to format C/C++/Obj-C code

sudo apt install clang-format
  • Section: universe/devel
  • Architecture: amd64
  • Source Package: llvm-defaults
  • 1 依赖
  • normalized package name match
  • 匹配方式:Clang Format
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: clang-format from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
dnf92%

git-clang-format 22.1.7-1.fc45

Integration of clang-format for git

http://llvm.org

sudo dnf install git-clang-format
  • License: Apache-2.0 WITH LLVM-exception OR NCSA
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: llvm
  • 4 依赖
  • 1 提供
  • installed executable or alias match
  • 匹配方式:Git Clang Format
Fedora Rawhide package metadata · dl.fedoraproject.org · 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

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

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