Sign inSign up

tmknom/shfmt

By tmknom

•Updated over 7 years ago

Formats shell script.

Image
0

6.4K

tmknom/shfmt repository overview

⁠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 [email protected]: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.

Tag summary

Content type

Image

Digest

Size

1.2 MB

Last updated

over 7 years ago

docker pull tmknom/shfmt