Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 1.39 KB

File metadata and controls

47 lines (28 loc) · 1.39 KB

BASH/SH CI Implementations

Implementations

Travis CI

Build Status

We use the go language environment since it's required by shfmt, this saves us from having to install go ourselves.

Linters - Static Code Analysis

Linters or Static Code Analyzers will check the programs source code for bugs, errors, and formatting issues.

Static Code Analysis Satisfies the ITSG33 Control SA-11(1) Static Code Analysis

Error Checking

Use ShellCheck to check your bash/sh for known issues.

Link to tool: ShellCheck GitHub Page

Command to Run ShellCheck

To simplify installation of this tool we are running it from inside a docker container

docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:stable script-to-test.sh

Pretty Printers

Use shfmt to ensure your script is formatted using a standard format. We are using the Google Shell Style Guide to format our scripts.

Link to tool: shfmt GitHub Page

Command to run shfmt

Unfortunately we cannot run shfmt from within a docker container as the diff functionality currently doesn't work

shfmt -d -i 2 -ci -w script-to-test.sh