shfmt-py 4.0.0


pip install shfmt-py

  Latest version

Released: May 13, 2026

Project Links

Meta
Author: Max Winterstein
Requires Python: >=3.9

Classifiers

Programming Language
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

PyPI version Supported Python versions Downloads License pre-commit.ci status

shfmt-py

Python-installable wrapper for shfmt, the shell script formatter.

Internally this package downloads the pre-built shfmt binary for your platform at install time.

Modeled after shellcheck-py, adapted for shfmt.

Installation

pip install shfmt-py

Usage

CLI

After installation, the shfmt binary is available on your PATH (or shfmt.exe on Windows).

As pre-commit hook

See pre-commit for instructions.

Sample .pre-commit-config.yaml:

- repo: https://github.com/maxwinterstein/shfmt-py
  rev: v3.13.0.3
  hooks:
    - id: shfmt

Versioning

shfmt-py is independently versioned. The PyPI version does not directly mirror the bundled shfmt version — check each GitHub release's notes for the exact shfmt version that release bundles.

  • Major — breaking change to shfmt-py itself (e.g. dropping a Python version, renaming the pre-commit hook id).
  • Minor — new upstream shfmt release bundled.
  • Patch — wrapper-only fix (hash regeneration, CI changes affecting users, etc.).

Releases 3.x.y.z and earlier used a 4-segment scheme aligned with upstream shfmt. From v4.0.0 onwards shfmt-py follows standard semver.

FAQ

Q: It won't get updated via e.g. Renovate Bot

A: Releases v4.0.0 and onwards use standard semver — no special Renovate config needed. For older 3.x.y.z releases you'll need "versioning": "pep440" (or see https://github.com/shfmt-py/update-via-renovate).

Q: I get something like SSL: CERTIFICATE_VERIFY_FAILED on macOS

A: Install certificates with e.g.: "/Applications/Python 3.9/Install Certificates.command". See here or here for a solution.

Extras:
Dependencies: