# 使用 Homebrew, Nix 安装 bashate

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

## 安装

```sh
sudo av install brew:bashate
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install bashate
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#bashate
```

  证据: nixpkgs package indexes: pkgs/by-name/ba/bashate/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:bashate
- **软件包管理器:** Homebrew
- **版本:** 2.1.1
- **来源摘要:** Code style enforcement for bash programs
- **主页:** <https://opendev.org/openstack/bashate>
- **仓库:** <https://github.com/openstack/bashate>
- **最后更新:** 2026-07-15T10:20:03Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- bashate (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.1.1
## 项目历史与用法

bashate is OpenStack's style checker for Bash scripts. It is essentially a pycodestyle-style lint gate for shell code, built for projects where Bash scripts are part of the reviewed and tested codebase.

### 项目历史

The official README calls bashate a pep8 equivalent for Bash scripts and says it attempts to fill the same automated code-review role for Bash that pep8 did in many OpenStack projects. It also states that bashate started in the DevStack project and would continue to evolve over time.

The OpenStack documentation and Opendev source identify it as an Apache-licensed OpenStack project with docs, source, bugs, release notes, and contribution pages. Its documented checks cover whitespace, indentation, line endings, line length, structure rules, `bash -n` syntax errors, and obsolete or unsafe syntax.

### 采用历史

bashate's adoption is tied to OpenStack's large shell-script surface, especially DevStack and project automation. The batch input shows Homebrew and Nix packaging; in practice, the tool is most valuable to contributors and CI jobs enforcing OpenStack-adjacent shell style.

The release notes and official tag list show a 0.x line followed by 1.0.0 and 2.x releases, enough history to treat it as a maintained OpenStack utility rather than a one-off script.

### 使用方式

Users run `bashate` against shell scripts to catch style and safety issues before review or CI. Its output intentionally follows the default pycodestyle output format, making it familiar in OpenStack's Python-heavy review culture.

The documented checks include trailing whitespace, hard tabs, non-multiple-of-four indents, missing final newline, missing shebang or `.sh` suffix, long lines, malformed control structures, heredoc termination, function declaration style, `bash -n` syntax errors, deprecated `$[` arithmetic, risky `local` declarations, and `[[` recommendations for comparisons.

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

bashate is package-nerd significant because it shows shell scripts becoming first-class reviewed artifacts in a large infrastructure project. It is not a general-purpose shell parser revolution; it is the small enforcement tool that makes a project's Bash style reproducible across laptops and CI workers.

It also captures an OpenStack packaging pattern: a narrow Python CLI published as a standalone package, documented by Sphinx, hosted in Opendev, and installed by package managers for repeatable developer workflows.

### 时间线

- 2010s: bashate starts in the DevStack project, according to the official README.
- 2010s: 0.x release tags establish the early style-checker line.
- 2020: OpenStack release-notes build documents the 0.5.x, 0.6.0, and 1.0.0 release notes.
- 2020s: Official tag list reaches the 2.x release line.
- 2020s: Homebrew and Nix package the `bashate` CLI.

### Related projects

- Related projects include DevStack, OpenStack's broader CI/review tooling, pycodestyle/pep8, ShellCheck, shfmt, and Bash itself. bashate's own README explicitly compares its role to pycodestyle.

### 来源

- Official Opendev tag list shows 0.1.0 through 2.1.1 tags.
- Official README says bashate is a pep8 equivalent for Bash scripts, started in DevStack, and follows pycodestyle output format.
- Official docs list project documentation, source, bug tracker, release notes, contributing docs, and supported checks.
- Official release notes page documents 0.5.x, 0.6.0, and 1.0.0 notes.
- input.source_facts.package-manager lists Homebrew and Nix packaging.


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - bashate: normalized package name match | nixpkgs package indexes: pkgs/by-name/ba/bashate/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/bashate.yml](https://github.com/mxcl/pkgdb/blob/main/combined/bashate.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
