Skip to content

AI21Labs/pre-commit-shfmt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pre-commit-shfmt

Main push and PR checks Tag checks CodeQL OpenSSF Scorecard

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.

About

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

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages