Sign inSign up

peterdavehello/shfmt

By peterdavehello

Updated over 4 years ago

🐳 Dockerized "shfmt" 🐚 an amazing shell script formatter

Image
3

100K+

peterdavehello/shfmt repository overview

shfmt

Build Status Docker Hub pulls

Docker Hub badge

Dockerized shfmt shell script formatter.

Please note that I originally built this Docker image because that there wasn't an official one, but now there it is, and it also use the Dockerfile in this repository as the reference to create the official one, as you can see https://github.com/mvdan/sh/issues/68, this repository might not be actively maintained.

Usage

Command line

Run Docker container using peterdavehello/shfmt image:

docker run --rm -it -v /path/of/scripts:/path/in/docker peterdavehello/shfmt:2.6.4 shfmt --version

Replace --version with the parameters you want, for example:

docker run --rm -it -v "$(pwd)":/scripts peterdavehello/shfmt:2.6.4 shfmt -sr -i 2 -d -ci /scripts

Don't forget to replace 2.6.4 with the latest tag or the tagged version you want.

GitLab CI example
shfmt:
  stage: test
  image: peterdavehello/shfmt:2.6.4
  before_script:
    - shfmt -version
  script:
    - shfmt -sr -i 2 -d -ci .
  tags:
    - docker

Tag summary

Content type

Image

Digest

Size

2.8 MB

Last updated

over 4 years ago

docker pull peterdavehello/shfmt