Metadata-Version: 2.4
Name: shfmt-py
Version: 3.13.0.3
Summary: Python wrapper around invoking shfmt (https://github.com/mvdan/sh)
Author-email: Max Winterstein <github@winterstein.io>
License-Expression: MIT
Project-URL: Homepage, https://github.com/maxwinterstein/shfmt-py
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

[![PyPI version](https://img.shields.io/pypi/v/shfmt-py.svg)](https://pypi.org/project/shfmt-py)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/shfmt-py.svg)](https://pypi.org/project/shfmt-py)
[![Downloads](https://img.shields.io/pypi/dm/shfmt-py.svg)](https://pypi.org/project/shfmt-py)
[![License](https://img.shields.io/github/license/MaxWinterstein/shfmt-py.svg)](https://github.com/MaxWinterstein/shfmt-py/blob/master/LICENSE)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/MaxWinterstein/shfmt-py/master.svg)](https://results.pre-commit.ci/latest/github/MaxWinterstein/shfmt-py/master)

# 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

```bash
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`:

```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][here1] or [here][here2] for a solution.


[shfmt]: https://github.com/mvdan/sh
[pre-commit]: https://pre-commit.com
[shellcheck-py]: https://github.com/shellcheck-py/shellcheck-py
[here1]: https://github.com/albertogeniola/MerossIot/issues/62#issuecomment-535769621
[here2]: https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error
