Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tmknom/shfmt
Dockernized shfmt. This formats shell script.
https://github.com/tmknom/shfmt
docker docker-image dockerfile formatter shell-script
Last synced: 16 days ago
JSON representation
Dockernized shfmt. This formats shell script.
- Host: GitHub
- URL: https://github.com/tmknom/shfmt
- Owner: tmknom
- License: apache-2.0
- Created: 2018-09-24T10:01:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-03T15:42:57.000Z (about 5 years ago)
- Last Synced: 2024-02-23T09:37:10.905Z (4 months ago)
- Topics: docker, docker-image, dockerfile, formatter, shell-script
- Language: Makefile
- Homepage: https://github.com/mvdan/sh
- Size: 14.6 KB
- Stars: 26
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-starred - shfmt
README
# shfmt
[![CircleCI](https://circleci.com/gh/tmknom/shfmt.svg?style=svg)](https://circleci.com/gh/tmknom/shfmt)
[![Docker Build Status](https://img.shields.io/docker/cloud/build/tmknom/shfmt.svg)](https://hub.docker.com/r/tmknom/shfmt/builds/)
[![Docker Automated build](https://img.shields.io/docker/cloud/automated/tmknom/shfmt.svg)](https://hub.docker.com/r/tmknom/shfmt/)
[![MicroBadger Size](https://img.shields.io/microbadger/image-size/tmknom/shfmt.svg)](https://microbadger.com/images/tmknom/shfmt)
[![MicroBadger Layers](https://img.shields.io/microbadger/layers/tmknom/shfmt.svg)](https://microbadger.com/images/tmknom/shfmt)
[![License](https://img.shields.io/github/license/tmknom/shfmt.svg)](https://opensource.org/licenses/Apache-2.0)Format shell script based on Docker.
This is [shfmt](https://github.com/mvdan/sh) wrapper.
## Requirements
- [Docker](https://www.docker.com/)
## Usage
### Format a file
```sh
docker run --rm -v $PWD:/work tmknom/shfmt foo.sh
```### Format all .sh extension
Use `-w` to write result to file instead of stdout.
```sh
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](https://google.github.io/styleguide/shell.xml).```sh
docker run --rm -v $PWD:/work tmknom/shfmt -i 2 -ci -w **/*.sh
```### Help
For details, refer to [mvdan/sh](https://github.com/mvdan/sh).
```sh
docker run --rm -v $PWD:/work tmknom/shfmt
```## Makefile targets
```text
build Build docker image
format Format code
help Show help
install Install requirements
lint Lint code
```## Development
### Installation
```shell
git clone [email protected]:tmknom/shfmt.git
cd shfmt
make install
```### Deployment
Automatically deployed by "[DockerHub Automated Build](https://docs.docker.com/docker-hub/builds/)" 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.