tmknom / shfmt

Dockernized shfmt. This formats shell script.

Home Page:https://github.com/mvdan/sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Dockernized shfmt. This formats shell script.

https://github.com/mvdan/sh

License:Apache License 2.0


Languages

Language:Makefile 53.3%Language:Dockerfile 35.7%Language:Shell 11.0%