Skip to content

fauust/pre-commit-shfmt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

pre-commit-shfmt hook

This project will be archived and you should now use https://github.com/fauust/pre-commit-shell.

pre-commit

Single pre-commit hook which runs shfmt on shell script files (forked from https://github.com/pecigonzalo/pre-commit-shfmt).

Usage

.pre-commit-config.yaml example:

- repo: https://github.com/fauust/pre-commit-fmt
  rev: v1.1
  hooks:
    - id: shell-fmt
      args: ["-d", "-i", "2", "-ci"]

The shfmt tool must be installed separately.

Alternative using docker

For CI systems or if you don't want to install shfmt, you can use the original docker image:

- repo: local
  hooks:
    - id: docker-shell-shfmt
      name: Run shfmt with docker
      entry: mvdan/shfmt:latest -d -i 2 -ci
      language: docker_image
      types: [shell]

Enjoy the clean code!

Packages

No packages published

Languages

  • Shell 100.0%