-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-shellcheck.doc.sh
More file actions
21 lines (18 loc) · 919 Bytes
/
run-shellcheck.doc.sh
File metadata and controls
21 lines (18 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit || { echo >&2 "please update to bash 5, see errors above" && exit 1; }
# Assumes tegonal's scripts were fetched with gt - adjust location accordingly
dir_of_tegonal_scripts="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)/../lib/tegonal-scripts/src"
source "$dir_of_tegonal_scripts/setup_tegonal_scripts.sh" "$dir_of_tegonal_scripts"
source "$dir_of_tegonal_scripts/qa/run-shellcheck.sh"
# shellcheck disable=SC2034 # is passed by name to runShellcheck
declare -a dirs=(
"$dir_of_tegonal_scripts"
"$dir_of_tegonal_scripts/../scripts"
"$dir_of_tegonal_scripts/../spec"
)
declare sourcePath="$dir_of_tegonal_scripts"
runShellcheck dirs "$sourcePath"
# pass the working directory of gt which usually is .gt in the root of your repository
# this will run shellcheck on all pull-hook.sh files
runShellcheckPullHooks ".gt"