Skip to main content

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

Project description

pre-commit.ci status

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.

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

Uploaded Source

File details

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

File metadata

  • Download URL: shfmt_py-3.12.0.2.tar.gz
  • Upload date:
  • Size: 4.5 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.12.0.2.tar.gz
Algorithm Hash digest
SHA256 6a0dc675b37d000eb236609cf15aedd9e7a538927ea02c57b617908b6f237e9c
MD5 00273f65e9c9e6d0fedaf12bf3256b5f
BLAKE2b-256 afd9a1ea26749bd19467e9fbfe7b34e6c8df517e01de4028a45b954eebe8c03b

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