macOS
brew install yapflocal Homebrew formula metadata
安装
brew install yapflocal Homebrew formula metadata
nix profile install nixpkgs#yapfnixpkgs package indexes · yapf · 来源: raw.githubusercontent.com
sudo pacman -S yapfArch Linux sync databases · yapf · 来源: geo.mirror.pkgbuild.com
sudo apt install python3-yapfDebian stable package indexes · python3-yapf · 来源: deb.debian.org
概览
Formatter for python code
历史
YAPF, Yet Another Python Formatter, is Google's clang-format-inspired formatter for Python source. Unlike style checkers that only report or repair selected PEP 8 violations, YAPF searches for a low-cost layout that conforms to a chosen style and rewrites the file.
The Google-owned GitHub repository was created on 2015-03-18, and PyPI history shows public 0.1.x packages in April 2015. The README explicitly says YAPF is based on clang-format, developed by Daniel Jasper, and that its goal is to produce code as good as a programmer would write while following a style guide.
YAPF's design grew out of formatter culture rather than linter culture. Its README contrasts the project with tools that remove lint errors and emphasizes a configurable formatting engine with named styles such as pep8, google, yapf, and facebook plus many individual knobs. Later changelog entries show continued maintenance for newer Python syntax and packaging shifts, including the move away from lib2to3 toward blib2to3 for Python 3.11-era parsing.
YAPF became one of the main Python auto-formatters of the mid-2010s, especially for teams that wanted clang-format-style configurability instead of a single canonical layout. Its README documents editor integrations, recursive formatting, diff mode for CI checks, local style discovery, and ignore files, all of which match adoption through developer tooling, pre-submit checks, and editor save hooks.
The formatter's long-term place changed after Black popularized less-configurable formatting, but YAPF remained important where repositories wanted Google/Facebook-like styles, large configuration surfaces, or incremental compatibility with existing formatting policy.
Typical CLI usage is `yapf -i file.py` for in-place formatting, `yapf -d` for a diff suitable for review or CI, and `yapf -r` for recursive directory formatting. The `yapf-diff` helper fits patch-oriented workflows by formatting only changed hunks.
Configuration is central to YAPF usage. The formatter searches local style files such as `.style.yapf`, `setup.cfg`, and `pyproject.toml`, supports predefined base styles, and offers many style options for projects that treat formatting as policy rather than taste.
YAPF matters because it represents the configurable branch of Python formatter history: closer to clang-format and gofmt in automation, but less doctrinaire than later formatters. In package collections it is a standard example of a developer tool whose value is mostly in repeatability, editor integration, and reducing style churn in diffs.
It also shows how Python tooling had to adapt as the language parser story changed. Maintaining a formatter across Python syntax releases is partly a packaging problem: the executable must track language versions, config formats, editor plugins, and CI behavior at the same time.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
local files
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.
Config paths the tool may read or write during local use.
.style.yapfsetup.cfgpyproject.toml~/.config/yapf/style.yapfignore可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
yapf | cli | 全局可执行文件 | |
yapf-diff | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/google/yapf
安装元数据
| 软件包键 | brew:yapf |
|---|---|
| 版本 | 0.43.0 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/yapf |
| 主页 | https://github.com/google/yapf |
| 仓库 | https://github.com/google/yapf |
| 上游文档 | https://github.com/google/yapf#readme |
| 许可证 | Apache-2.0 |
| 源码归档 | https://files.pythonhosted.org/packages/23/97/b6f296d1e9cc1ec25c7604178b48532fa5901f721bcf1b8d8148b13e5588/yapf-0.43.0.tar.gz |
| 依赖 | python@3.14 |
| Bottle | 可用 (于 all) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | yapf |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
python3-yapf 0.40.2-3
public modules for yapf (Python 3)
https://github.com/google/yapf
sudo apt install python3-yapfyapf3 0.40.2-3
Python code formatter for different styles (Python 3)
https://github.com/google/yapf
sudo apt install yapf3yapf
nix profile install nixpkgs#yapfpython3-yapf 0.33.0-1
public modules for yapf (Python 3)
https://github.com/google/yapf
sudo apt install python3-yapfyapf3 0.33.0-1
Python code formatter for different styles (Python 3)
https://github.com/google/yapf
sudo apt install yapf3yapf 0.43.0-2
Python style guide checker
https://github.com/google/yapf
sudo pacman -S yapf来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.