Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterdavehello/docker-shfmt
🐳 Dockerized "shfmt" 🐚 an amazing shell script formatter
https://github.com/peterdavehello/docker-shfmt
bash checker container docker docker-image dockerfile hacktoberfest image script sh shell shfmt style stylelint
Last synced: 11 days ago
JSON representation
🐳 Dockerized "shfmt" 🐚 an amazing shell script formatter
- Host: GitHub
- URL: https://github.com/peterdavehello/docker-shfmt
- Owner: PeterDaveHello
- Created: 2018-07-15T09:14:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-17T14:28:05.000Z (almost 3 years ago)
- Last Synced: 2024-10-19T23:24:10.772Z (18 days ago)
- Topics: bash, checker, container, docker, docker-image, dockerfile, hacktoberfest, image, script, sh, shell, shfmt, style, stylelint
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/peterdavehello/shfmt/
- Size: 19.5 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shfmt
[![Build Status](https://app.travis-ci.com/PeterDaveHello/docker-shfmt.svg?branch=master)](https://app.travis-ci.com/PeterDaveHello/docker-shfmt)
[![Docker Hub pulls](https://img.shields.io/docker/pulls/peterdavehello/shfmt.svg)](https://hub.docker.com/r/peterdavehello/shfmt/)[![Docker Hub badge](https://dockeri.co/image/peterdavehello/shfmt)](https://hub.docker.com/r/peterdavehello/shfmt/)
Dockerized [shfmt](https://github.com/mvdan/sh#shfmt) shell script formatter.
**Please note that I originally built this Docker image because that there wasn't an official one, but now there it is, and it also uses the Dockerfile from this repository as the reference to create the official one, as you can see , this repository might not be actively maintained.**
## Usage
### Command line
Run Docker container using [peterdavehello/shfmt](https://hub.docker.com/r/peterdavehello/shfmt) image:
```sh
docker run --rm -it -v /path/of/scripts:/path/in/docker peterdavehello/shfmt:2.6.4 shfmt --version
```Replace `--version` with the parameters you want, for example:
```sh
docker run --rm -it -v "$(pwd)":/scripts peterdavehello/shfmt:2.6.4 shfmt -sr -i 2 -d -ci /scripts
```Don't forget to replace `2.6.4` with the latest tag or the tagged version you want.
### GitLab CI example
```yaml
shfmt:
stage: test
image: peterdavehello/shfmt:2.6.4
before_script:
- shfmt -version
script:
- shfmt -sr -i 2 -d -ci .
tags:
- docker
```