Skip to content

Commit

Permalink
Remove shellcheck ignore list
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel committed Mar 5, 2021
1 parent 16fac8f commit dd9bf82
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions scripts/chk_shellscripts/chk_shellscripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,14 @@ set -eu

REPO_ROOT="$(dirname "$0")"/../..
REPO_ROOT=$(realpath "${REPO_ROOT}")
IGNORE_FILENAME="ignore.txt"
IGNORE_FILE="${REPO_ROOT}/scripts/chk_shellscripts/${IGNORE_FILENAME}"

FOUND_FILES_TMP=$(mktemp)
IGNORE_FILES_TMP=$(mktemp)
trap 'rm -f ${FOUND_FILES_TMP} ; rm -f ${IGNORE_FILES_TMP}' EXIT

sort < "${IGNORE_FILE}" >"${IGNORE_FILES_TMP}"
cd "${REPO_ROOT}"
find . -type f -name "*.sh" | sort >"${FOUND_FILES_TMP}"

SHELLCHECK=${SHELLCHECK:-"$(command -v -- shellcheck)"}
if [ ! -f "${SHELLCHECK}" ]; then
echo "error: shellcheck '${SHELLCHECK}' not found."
exit 1
fi

FILES=$(join -v2 "${IGNORE_FILES_TMP}" "${FOUND_FILES_TMP}")

# shellcheck disable=SC2086
"${SHELLCHECK}" ${FILES[*]}
mapfile -t FILES < <(find . -type f -name "*.sh")
"${SHELLCHECK}" "${FILES[@]}"

0 comments on commit dd9bf82

Please sign in to comment.