Skip to content

Commit f5a7579

Browse files
authored
style: format sh files (#55)
Use `shfmt` to unify formatting of shell scripts.
1 parent 7c84e02 commit f5a7579

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

src/scripts/analyze-code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function join() {
1616
printf "%s" "${first}" "${@/#/$separator}"
1717
}
1818

19-
IFS=' ' read -ra RULE_ARRAY <<< "${PARAM_STR_RULES}"
19+
IFS=' ' read -ra RULE_ARRAY <<<"${PARAM_STR_RULES}"
2020
ARGS="${ARGS} --config $(join ' --config ' "${RULE_ARRAY[@]}")"
2121

2222
if [ "${PARAM_BOOL_VERBOSE}" -eq 1 ]; then

src/scripts/assess-image.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88

99
PARAM_STR_IMAGE=$(circleci env subst "${PARAM_STR_IMAGE}")
1010

11-
function scan_secrets () {
11+
function scan_secrets() {
1212
local args=(image "--scanners=secret" "--image-config-scanners=secret")
1313

1414
if [[ "${PARAM_STR_IMAGE}" == *.tar ]]; then
@@ -22,15 +22,15 @@ function scan_secrets () {
2222
set +x
2323
}
2424

25-
function scan_vuln () {
25+
function scan_vuln() {
2626
local args=()
2727

2828
if [[ "${PARAM_STR_IMAGE}" == *.tar ]]; then
2929
args+=("docker-archive:${PARAM_STR_IMAGE}")
3030
else
3131
args+=("docker:${PARAM_STR_IMAGE}")
3232
fi
33-
33+
3434
if [[ -n "${PARAM_STR_IGNORE_FIX_STATUS}" ]]; then
3535
args+=("--ignore-states=${PARAM_STR_IGNORE_FIX_STATUS}")
3636
fi
@@ -59,7 +59,7 @@ for scanner in ${PARAM_STR_SCANNERS}; do
5959
elif [[ $scanner == "secret" ]]; then
6060
scan_secrets
6161
else
62-
echo "Unknow image scanner: $scanner"
62+
echo "Unknown image scanner: $scanner"
6363
exit 1
6464
fi
6565
done

src/scripts/export-git-branches.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ if [[ -n ${CIRCLE_BRANCH} ]]; then
1111
CURRENT_BRANCH=${CIRCLE_BRANCH}
1212
fi
1313

14-
echo "export GIT_BASE_BRANCH='${BASE_BRANCH}'" >> "${BASH_ENV}"
15-
echo "export GIT_CURRENT_BRANCH='${CURRENT_BRANCH}'" >> "${BASH_ENV}"
14+
echo "export GIT_BASE_BRANCH='${BASE_BRANCH}'" >>"${BASH_ENV}"
15+
echo "export GIT_CURRENT_BRANCH='${CURRENT_BRANCH}'" >>"${BASH_ENV}"

src/scripts/export-gitleaks-args.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ if [[ -n "${PARAM_STR_BASELINE_REPORT}" ]]; then
1010
ARGS="${ARGS} --baseline-path=${PARAM_STR_BASELINE_REPORT}"
1111
fi
1212

13-
echo "export GITLEAKS_ARGS='${ARGS}'" >> "${BASH_ENV}"
13+
echo "export GITLEAKS_ARGS='${ARGS}'" >>"${BASH_ENV}"

src/scripts/install-grype.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
BASE_URL="https://raw.githubusercontent.com/anchore/grype"
4-
INSTALL_SCRIPT_URL="${BASE_URL}/main/install.sh"
4+
INSTALL_SCRIPT_URL="${BASE_URL}/main/install.sh"
55
GRYPE_DEST_DIR="${GRYPE_DEST_DIR:-/usr/local/bin}"
66

7-
function install_grype () {
7+
function install_grype() {
88
local script_args=(-b "${GRYPE_DEST_DIR}")
99

1010
if [[ -n "${PARAM_STR_VERSION}" ]]; then

src/scripts/install-syft.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
BASE_URL="https://raw.githubusercontent.com/anchore/syft"
4-
INSTALL_SCRIPT_URL="${BASE_URL}/main/install.sh"
4+
INSTALL_SCRIPT_URL="${BASE_URL}/main/install.sh"
55
SYFT_DEST_DIR="${SYFT_DEST_DIR:-/usr/local/bin}"
66

7-
function install_syft () {
7+
function install_syft() {
88
local script_args=(-b "${SYFT_DEST_DIR}")
99

1010
if [[ -n "${PARAM_STR_VERSION}" ]]; then

src/scripts/install-trivy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
BASE_URL="https://raw.githubusercontent.com/aquasecurity/trivy"
4-
INSTALL_SCRIPT_URL="${BASE_URL}/main/contrib/install.sh"
4+
INSTALL_SCRIPT_URL="${BASE_URL}/main/contrib/install.sh"
55
TRIVY_DEST_DIR="${TRIVY_DEST_DIR:-/usr/local/bin}"
66

7-
function install_trivy () {
7+
function install_trivy() {
88
local script_args=(-b "${TRIVY_DEST_DIR}")
99

1010
if [[ -n "${PARAM_STR_VERSION}" ]]; then

0 commit comments

Comments
 (0)