Skip to main content

Python wrapper around invoking shfmt (https://github.com/mvdan/sh)

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shfmt_py-4.0.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shfmt_py-4.0.0-py2.py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 2Python 3Windows x86-64

shfmt_py-4.0.0-py2.py3-none-manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded Python 2Python 3

shfmt_py-4.0.0-py2.py3-none-manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded Python 2Python 3

shfmt_py-4.0.0-py2.py3-none-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded Python 2Python 3macOS 11.0+ ARM64

shfmt_py-4.0.0-py2.py3-none-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded Python 2Python 3macOS 10.9+ x86-64

File details

Details for the file shfmt_py-4.0.0.tar.gz.

File metadata

  • Download URL: shfmt_py-4.0.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for shfmt_py-4.0.0.tar.gz
Algorithm Hash digest
SHA256 1e5fdacf40aabaa77a97639d52a6220df0893b46658d82b7f136f4e66e2b2fb0
MD5 2f1d417951977566dace51206e294352
BLAKE2b-256 06d5c2ad5c6593a34da7344cf39bde65763e8cda752589074ba1619e55b317ad

See more details on using hashes here.

File details

Details for the file shfmt_py-4.0.0-py2.py3-none-win_amd64.whl.

File metadata

  • Download URL: shfmt_py-4.0.0-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for shfmt_py-4.0.0-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bd4f3d36264d4ba8b014ff73e5e702aaa2345845c021f563480128de3705135b
MD5 9579de798490f8898efea1d97c75e75b
BLAKE2b-256 9520db2430d9262d2cffadcad2b330441e13031f1ab849ec069659edb7f23257

See more details on using hashes here.

File details

Details for the file shfmt_py-4.0.0-py2.py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for shfmt_py-4.0.0-py2.py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e57877abe0177a9da7bbb5390fe7e96aa19b00958189a025634039aef8834d44
MD5 533132738dc9279155750757f18714ee
BLAKE2b-256 6443e3965a25bb39555f2791c6860214f62b6f976f9ac7e9786073364bcdd9a6

See more details on using hashes here.

File details

Details for the file shfmt_py-4.0.0-py2.py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for shfmt_py-4.0.0-py2.py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4701336c3cb5f3959a5e85481b14f02054ea094b3c666f3d04649bbe10de3c25
MD5 fb73cdbca434cf19a78f382d9b9ac004
BLAKE2b-256 9aa96fce944efa530db941edd11388d70dc7384aaf12169a3b0847b6a6c987b0

See more details on using hashes here.

File details

Details for the file shfmt_py-4.0.0-py2.py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shfmt_py-4.0.0-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb3d236163ff39c7790953e069938caf247e7646399f7a059f00f65d4e6916d6
MD5 f1e96cde7076f08339b741c06b56bbfe
BLAKE2b-256 a8829564a2c2a76fbec94db1b3a3c37a9a1d00e7eafca2cdd2e0d19082618d7e

See more details on using hashes here.

File details

Details for the file shfmt_py-4.0.0-py2.py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for shfmt_py-4.0.0-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 75a4919a03fb3bcff9795e3cc7b971e37e74905654d2f11605001cab42e5f92f
MD5 a75063ec29de0abfdb87159c58702e0a
BLAKE2b-256 5a1d8f72824e2a0e06dc0bc2687baacaba0573be7d2e93c01d1e895fddd8c13e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page