Automic VaultAutomic Vault

brew

使用 Homebrew, Nix, pacman, apt 安装 yapf

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

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install yapf

local Homebrew formula metadata

概览

软件包摘要

Formatter for python code

命令和别名

  • yapf
  • yapf-diff

历史

项目历史与用法

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.

时间线

  • 2015-03-18: google/yapf repository is created on GitHub.
  • 2015-04-07: PyPI records an early public 0.1.4 upload.
  • 2023-06-13: YAPF 0.40.0 changelog notes Python 3.11 support and replacement of lib2to3 with blib2to3.
  • 2023-09-22: YAPF 0.40.2 is published on PyPI.
  • 2024-11-14: YAPF 0.43.0 is published on PyPI.

Related projects

  • clang-format is the formatter model named by YAPF's README.
  • autopep8 and pep8ify are older Python formatting tools contrasted by YAPF's documentation.
  • Black is the later opinionated Python formatter often compared with YAPF in formatter choice discussions.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 1 个平台目标。
  • 安装时包含 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
.style.yapfsetup.cfgpyproject.toml~/.config/yapf/style.yapfignore

可执行文件

已安装的可执行文件

命令类型暴露范围备注
yapfcli全局可执行文件
yapf-diffcli全局可执行文件

新鲜度

版本和新鲜度

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

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

https://github.com/google/yapf

  • 信息No package-manager update timestamp was available.低 置信度
  • 信息No cached GitHub release or tag data was available.https://github.com/google/yapfnone 置信度

安装元数据

软件包元数据

软件包键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 DatabaseHomebrew formula API
Taphomebrew/core
Full Nameyapf
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

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

Debian apt95%

python3-yapf 0.40.2-3

public modules for yapf (Python 3)

https://github.com/google/yapf

sudo apt install python3-yapf
  • Section: python
  • Architecture: all
  • Source Package: yapf
  • 3 依赖
  • normalized package name match
  • 匹配方式:Yapf
Debian stable package indexes · deb.debian.org · Debian stable package indexes: python3-yapf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

yapf3 0.40.2-3

Python code formatter for different styles (Python 3)

https://github.com/google/yapf

sudo apt install yapf3
  • Section: python
  • Architecture: all
  • Source Package: yapf
  • 2 依赖
  • normalized package name match
  • 匹配方式:Yapf
Debian stable package indexes · deb.debian.org · Debian stable package indexes: yapf3 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

yapf

nix profile install nixpkgs#yapf
  • normalized package name match
  • 匹配方式:Yapf
nixpkgs package indexes · raw.githubusercontent.com · nixpkgs package indexes: yapf from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
Ubuntu apt95%

python3-yapf 0.33.0-1

public modules for yapf (Python 3)

https://github.com/google/yapf

sudo apt install python3-yapf
  • Section: universe/python
  • Architecture: all
  • Source Package: yapf
  • 4 依赖
  • normalized package name match
  • 匹配方式:Yapf
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: python3-yapf from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt95%

yapf3 0.33.0-1

Python code formatter for different styles (Python 3)

https://github.com/google/yapf

sudo apt install yapf3
  • Section: universe/python
  • Architecture: all
  • Source Package: yapf
  • 2 依赖
  • normalized package name match
  • 匹配方式:Yapf
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: yapf3 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
pacman95%

yapf 0.43.0-2

Python style guide checker

https://github.com/google/yapf

sudo pacman -S yapf
  • License: Apache-2.0
  • Architecture: any
  • 2 依赖
  • normalized package name match
  • 匹配方式:Yapf
Arch Linux sync databases · geo.mirror.pkgbuild.com · Arch Linux sync databases: yapf from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

来源线索

由仓库数据生成

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

使用的来源

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • 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