maint(linux): remove several shellcheck directives and warnings

This change improves our `.shellcheckrc` file so that several directives
are no longer needed and source files are still found. Also remove some
directives that are no longer necessary, either because the changes to
`.shellcheckrc` makes them obsolete, or because the lines changed so
that they no longer contain the problem.

Also remove some shellcheck warnings.

Build-bot: skip
Test-bot: skip
This commit is contained in:
Eberhard Beilharz 2025-09-23 17:55:01 +02:00
parent ceea0eea46
commit db3cd5092d
No known key found for this signature in database
GPG key ID: E9140597606020D3
6 changed files with 10 additions and 16 deletions

View file

@ -1,5 +1,6 @@
external-sources=true external-sources=true
# If you get SC1091 for sourced files, add the following setting to source-path=resources/build/
# your .vscode/settings.json file: source-path=resources/
# "shellcheck.useWorkspaceRootAsCwd": false source-path=SCRIPTDIR
source-path=linux/ibus-keyman/tests/scripts/

View file

@ -104,9 +104,6 @@
"C_Cpp.clang_format_fallbackStyle": "Google", "C_Cpp.clang_format_fallbackStyle": "Google",
"bashIde.explainshellEndpoint": "http://localhost:5000", "bashIde.explainshellEndpoint": "http://localhost:5000",
"bashIde.highlightParsingErrors": true, "bashIde.highlightParsingErrors": true,
"shellcheck.customArgs": [
"--external-sources --source-path=resources/build/"
],
"C_Cpp.errorSquiggles": "EnabledIfIncludesResolve", "C_Cpp.errorSquiggles": "EnabledIfIncludesResolve",
"shellcheck.useWorkspaceRootAsCwd": false "shellcheck.useWorkspaceRootAsCwd": true
} }

View file

@ -1,15 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
while [ -n "$1" ]; do while [[ -n "$1" ]]; do
if [ ! -d "$1" ]; then if [[ ! -d "$1" ]]; then
shift shift
continue continue
fi fi
pushd "$1" > /dev/null pushd "$1" > /dev/null
while IFS= read -r -d '' file; do while IFS= read -r -d '' file; do
testname=$(basename "$file" .kmx) testname=$(basename "${file}" .kmx)
#shellcheck disable=SC2059 #shellcheck disable=SC2059
printf "$(basename "$file")\t${testname#k_}\n" printf "$(basename "${file}")\t${testname#k_}\n"
done < <(find . -name \*.kmx -print0 | sort -z) done < <(find . -name \*.kmx -print0 | sort -z)
popd > /dev/null popd > /dev/null
exit 0 exit 0

View file

@ -2,7 +2,6 @@
set -eu set -eu
TESTDIR=${XDG_DATA_HOME:-${HOME}/.local/share}/keyman/test_kmx TESTDIR=${XDG_DATA_HOME:-${HOME}/.local/share}/keyman/test_kmx
# shellcheck source=linux/ibus-keyman/tests/scripts/test-helper.inc.sh
. "$(dirname "$0")"/test-helper.inc.sh . "$(dirname "$0")"/test-helper.inc.sh
if [[ -v KEYMAN_PKG_BUILD ]]; then if [[ -v KEYMAN_PKG_BUILD ]]; then

View file

@ -3,7 +3,6 @@
set -eu set -eu
# shellcheck disable=SC2034
TOP_SRCDIR=${top_srcdir:-$(realpath "$(dirname "$0")/../..")} TOP_SRCDIR=${top_srcdir:-$(realpath "$(dirname "$0")/../..")}
TESTBASEDIR=${XDG_DATA_HOME:-${HOME}/.local/share}/keyman TESTBASEDIR=${XDG_DATA_HOME:-${HOME}/.local/share}/keyman
TESTDIR=${TESTBASEDIR}/test_kmx TESTDIR=${TESTBASEDIR}/test_kmx
@ -11,7 +10,6 @@ CLEANUP_FILE=/tmp/ibus-keyman-test-cleanup
PID_FILE=/tmp/ibus-keyman-test.pids PID_FILE=/tmp/ibus-keyman-test.pids
ENV_FILE=/tmp/keyman-env.txt ENV_FILE=/tmp/keyman-env.txt
# shellcheck disable=SC1091
. "$(dirname "$0")"/test-helper.inc.sh . "$(dirname "$0")"/test-helper.inc.sh
local_cleanup() { local_cleanup() {
@ -69,7 +67,7 @@ function run_tests() {
G_TEST_BUILDDIR="$(dirname "$0")/../../../build/$(arch)/${CONFIG}/tests" G_TEST_BUILDDIR="$(dirname "$0")/../../../build/$(arch)/${CONFIG}/tests"
setup "$DISPLAY_SERVER" "$ENV_FILE" "$CLEANUP_FILE" "$PID_FILE" --standalone setup "${DISPLAY_SERVER}" "${ENV_FILE}" "${CLEANUP_FILE}" "${PID_FILE}" --standalone
if [[ "${DOCKER_RUNNING:-false}" == "true" ]]; then if [[ "${DOCKER_RUNNING:-false}" == "true" ]]; then
echo "# NOTE: When the tests fail check ibus-engine-keyman.log, ibus-daemon.log and km-test-server.log in build/docker-linux/tmp/!" echo "# NOTE: When the tests fail check ibus-engine-keyman.log, ibus-daemon.log and km-test-server.log in build/docker-linux/tmp/!"

View file

@ -3,7 +3,6 @@
## START STANDARD BUILD SCRIPT INCLUDE ## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary # adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
# shellcheck source=resources/build/builder-full.inc.sh
. "${THIS_SCRIPT%/*}/../../resources/build/builder-full.inc.sh" . "${THIS_SCRIPT%/*}/../../resources/build/builder-full.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE ## END STANDARD BUILD SCRIPT INCLUDE