tools/shellcheck.sh: allow overriding the shellcheck path
[babeltrace.git] / tools / shellcheck.sh
CommitLineData
86a9f7d3
MJ
1#!/bin/bash
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5# SPDX-FileCopyrightText: 2023 Michael Jeanson <mjeanson@efficios.com>
6
7set -eu
8
b939afe5 9shellcheck=${SHELLCHECK:-shellcheck}
86a9f7d3
MJ
10retcode=0
11
12while read -r script_file; do
13 echo "Running ShellCheck on \`$script_file\`"
14 pushd "${script_file%/*}" >/dev/null
b939afe5 15 "$shellcheck" -x "${script_file##*/}" || retcode=$?
86a9f7d3
MJ
16 popd >/dev/null
17done <<< "$(find . -type f -name '*.sh' \
18 ! -path './.git/*' \
19 ! -path ./config/ltmain.sh \
20 ! -path ./tests/utils/tap-driver.sh \
21 ! -path ./tests/utils/tap/tap.sh)"
22
23exit $retcode
This page took 0.035091 seconds and 4 git commands to generate.