Skip to content
Dockernized shfmt. This formats shell script.
Branch: master
Clone or download
Latest commit 99c1353 May 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Initial commit Sep 24, 2018
hooks Initial commit Sep 24, 2018
.dockerignore Initial commit Sep 24, 2018
.gitignore Initial commit Sep 24, 2018
.markdownlint.json Initial commit Sep 24, 2018
.yamllint Implement make lint-yaml and format-yaml Sep 28, 2018
Dockerfile Bump shfmt to 2.6.4 May 3, 2019
LICENSE Initial commit Sep 24, 2018
Makefile Implement make lint-yaml and format-yaml Sep 28, 2018
README.md Update badge url May 3, 2019

README.md

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.

You can’t perform that action at this time.