Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.5 KB

File metadata and controls

31 lines (26 loc) · 1.5 KB

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:
    # Choose one of:
    - id: shfmt         # prebuilt upstream executable
    - id: shfmt-src     # build from source (requires/installs Go to build)
    - id: shfmt-docker  # Docker image (requires Docker to run)

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. The one that builds from source is available as shfmt-src.