Skip to content

fauust/pre-commit-shell

Repository files navigation

pre-commit-shell hooks

pre-commit pre-commit

pre-commit hooks which runs the following programs on shell script files:

Usage

.pre-commit-config.yaml example:

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

shfmt and shellcheck tools must be installed separately.

Alternative using docker (for CI systems)

For CI systems or if you don't want to install the tools locally, you can use the docker official images:

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

About

shell pre-commit hooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages