ForkAI21 LabsAI21 Labspublished Jul 20, 2026seen 5d

AI21Labs/pre-commit-shfmt

forked from scop/pre-commit-shfmt

Open original ↗

Captured source

source ↗
published Jul 20, 2026seen 5dcaptured 5dhttp 200method plain

AI21Labs/pre-commit-shfmt

Description: shfmt hook for prek and pre-commit, with auto install

Language: Python

License: MIT

Stars: 0

Forks: 0

Open issues: 0

Created: 2026-07-20T15:37:06Z

Pushed: 2026-07-21T06:48:22Z

Default branch: main

Fork: yes

Parent repository: scop/pre-commit-shfmt

Archived: no

README:

pre-commit-shfmt

![Main push and PR checks](https://github.com/scop/pre-commit-shfmt/actions/workflows/check.yml) ![Tag checks](https://github.com/scop/pre-commit-shfmt/actions/workflows/check-tag.yml) ![CodeQL](https://github.com/scop/pre-commit-shfmt/actions/workflows/github-code-scanning/codeql) ![OpenSSF Scorecard](https://scorecard.dev/viewer/?uri=github.com%2Fscop%2Fpre-commit-shfmt)

shfmt hook for prek and pre-commit, with auto install.

Usage in .pre-commit-config.yaml:

- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.13.1-1
hooks:
- id: shfmt # prebuilt upstream executable

> #### Notes > > From v3.12.0-2 on, the default args passed to shfmt > no longer contain `-s`. > > From v3.7.0-2 on, the shfmt id points to the variant that uses a prebuilt > upstream executable.

Development

Use run.sh to run tests or tox inside a local virtualenv. On first run it creates .venv and installs the package with its test and dev extras, reusing the environment on subsequent runs.

./run.sh pytest # run the test suite
./run.sh pytest -k gpu # extra args are forwarded to pytest
./run.sh tox # run tox across the configured interpreters

Set PYTHON to control the interpreter used to bootstrap the virtualenv, e.g. PYTHON=python3.13 ./run.sh pytest.