/shfmt

Dockernized shfmt. This formats shell script.

Primary LanguageMakefileApache License 2.0Apache-2.0

shfmt

CircleCI Docker Build Status Docker Automated build MicroBadger Size MicroBadger Layers License

Format shell script based on Docker.

This is shfmt wrapper.

Requirements

Usage

Format a file

docker run --rm -v $PWD:/work tmknom/shfmt foo.sh

Format all .sh extension

Use -w to write result to file instead of stdout.

docker run --rm -v $PWD:/work tmknom/shfmt -w **/*.sh

Format Google's Shell Style Guide

Use -i N to indent with a number of spaces instead of tabs. Get the formatting appropriate for Google's Shell Style Guide.

docker run --rm -v $PWD:/work tmknom/shfmt -i 2 -ci -w **/*.sh

Help

For details, refer to mvdan/sh.

docker run --rm -v $PWD:/work tmknom/shfmt

Makefile targets

build                          Build docker image
format                         Format code
help                           Show help
install                        Install requirements
lint                           Lint code

Development

Installation

git clone git@github.com:tmknom/shfmt.git
cd shfmt
make install

Deployment

Automatically deployed by "DockerHub Automated Build" after merge.

Deployment Pipeline

  1. GitHub - Version Control System
  2. CircleCI - Continuous Integration
  3. Docker Hub - Docker Registry
  4. MicroBadger - Docker Inspection

License

Apache 2 Licensed. See LICENSE for full details.