[fix] apply shell formating / shfmt (make format.shell)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2025-07-16 17:52:32 +02:00
committed by Markus Heiser
parent cd062d7349
commit 8c2c3430da
16 changed files with 492 additions and 419 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: AGPL-3.0-or-later
test.help(){
test.help() {
cat <<EOF
test.:
yamllint : lint YAML files (YAMLLINT_FILES)
@@ -28,7 +28,8 @@ test.yamllint() {
}
test.pylint() {
( set -e
(
set -e
pyenv.activate
PYLINT_OPTIONS="--rcfile .pylintrc"
@@ -41,10 +42,10 @@ test.pylint() {
build_msg TEST "[pylint] ./searx ./searxng_extra ./tests"
# shellcheck disable=SC2086
pylint ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \
--ignore=searx/engines \
searx searx/searxng.msg \
searxng_extra searxng_extra/docs_prebuild \
tests
--ignore=searx/engines \
searx searx/searxng.msg \
searxng_extra searxng_extra/docs_prebuild \
tests
)
dump_return $?
}
@@ -60,13 +61,13 @@ test.pyright() {
build_msg TEST "[pyright/types] suppress warnings related to intentional monkey patching"
# We run Pyright in the virtual environment because pyright executes
# "python" to determine the Python version.
pyenv.cmd npx --no-install pyright -p pyrightconfig.json \
| grep -E '\.py:[0-9]+:[0-9]+'\
| grep -v '/engines/.*.py.* - warning: "logger" is not defined'\
| grep -v '/plugins/.*.py.* - error: "logger" is not defined'\
| grep -v '/engines/.*.py.* - warning: "supported_languages" is not defined' \
| grep -v '/engines/.*.py.* - warning: "language_aliases" is not defined' \
| grep -v '/engines/.*.py.* - warning: "categories" is not defined'
pyenv.cmd npx --no-install pyright -p pyrightconfig.json |
grep -E '\.py:[0-9]+:[0-9]+' |
grep -v '/engines/.*.py.* - warning: "logger" is not defined' |
grep -v '/plugins/.*.py.* - error: "logger" is not defined' |
grep -v '/engines/.*.py.* - warning: "supported_languages" is not defined' |
grep -v '/engines/.*.py.* - warning: "language_aliases" is not defined' |
grep -v '/engines/.*.py.* - warning: "categories" is not defined'
# ignore exit value from pyright
# dump_return ${PIPESTATUS[0]}
return 0
@@ -93,7 +94,8 @@ test.unit() {
test.coverage() {
build_msg TEST 'unit test coverage'
( set -e
(
set -e
pyenv.activate
# shellcheck disable=SC2086
python -m nose2 ${TEST_NOSE2_VERBOSE} -C --log-capture --with-coverage --coverage searx -s tests/unit
@@ -114,7 +116,7 @@ test.rst() {
build_msg TEST "[reST markup] ${RST_FILES[*]}"
for rst in "${RST_FILES[@]}"; do
pyenv.cmd rst2html --halt error "$rst" > /dev/null || die 42 "fix issue in $rst"
pyenv.cmd rst2html --halt error "$rst" >/dev/null || die 42 "fix issue in $rst"
done
}
@@ -132,7 +134,7 @@ test.pybabel() {
}
test.clean() {
build_msg CLEAN "test stuff"
build_msg CLEAN "test stuff"
rm -rf geckodriver.log .coverage coverage/
dump_return $?
}