Style Guide¶
Abstract
Our style guide for checks.
Bash¶
Scripts are formated with shfmt, shfmt as docker; following Google’s Style Guide,
shfmt -i 2 -ci
.Make sure to test against shellcheck.
Use
set -euo pipefail
, see Safer bash scripts.Scripts should fail on errors (
exit 1
)
Color Variables¶
- Info
yellow
- Passing
green
- Error
red
# Vars
# Color
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_RED=$ESC_SEQ"31;01m"
echo -en "$COL_YELLOW Running repository setup checks ...$COL_RESET\n"