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.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.

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-3.13.0.1.tar.gz (9.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for shfmt_py-3.13.0.1.tar.gz
Algorithm Hash digest
SHA256 11895f0a851cd866fe936e54130d501754c5b24f0f9d629023303892dd6ed616
MD5 1ef78bf4430ff5fa9e2d90f8d3d96ee4
BLAKE2b-256 9586e107642183529b99bb666c0d1bf34d01ccef84a3335d404e613d47fa5858

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