Python wrapper around invoking shfmt (https://github.com/mvdan/sh)
Project Links
Meta
Author: Max Winterstein
Requires Python: >=3.9
Classifiers
Programming Language
- Python :: 3
- Python :: 3 :: Only
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
shfmt-py
A python wrapper to provide a pip-installable shfmt binary.
Internally this package provides a convenient way to download the pre-built shellcheck binary for your particular platform.
This package is totally cloned from shellcheck-py and modified to provide shfmt instead.
Installation
pip install shfmt-py
Usage
CLI
After installation, the shfmt binary should be available in your
environment (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.12.0.1
hooks:
- id: shfmt
FAQ
Q: It won't get updated via e.g. Renovate Bot
A: 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.
3.12.0.2
Jul 08, 2025
3.11.0.2
Mar 12, 2025
3.7.0.1
Aug 20, 2023
3.4.3.1
Feb 20, 2022
3.3.1.8
Aug 29, 2021
3.3.1.7
Aug 25, 2021
3.3.1.6
Aug 25, 2021
3.3.1.5
Aug 24, 2021
3.3.1.4
Aug 24, 2021
3.3.1.3
Aug 24, 2021
3.3.1.2
Aug 24, 2021
3.3.1.1
Aug 24, 2021
Files in release
No dependencies