diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2025-07-16 15:54:54 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-07-28 12:53:26 +0200 |
| commit | 67e423edb25a3b565cd649a04ae73aa6446115d4 (patch) | |
| tree | 405079ee7caa9a3fece445443db8721630a5a7dc /utils/lib_sxng_test.sh | |
| parent | 7ee3dc9d74c845ad0c9cda52b300b7a4bb0da1c7 (diff) | |
[enh] CI - add shell script formatter
Implement rules and functions to format shell scripts:
$ make format.shell
or alternatively to format all source code:
$ make format
The formatter `shfmt` reads the rules from the editorconfig[1]
If any EditorConfig files are found, they will be used to apply formatting
options. If any parser or printer flags are given to the tool, no
EditorConfig files will be used.
[1] https://github.com/patrickvane/shfmt?tab=readme-ov-file#description
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lib_sxng_test.sh')
| -rwxr-xr-x | utils/lib_sxng_test.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/lib_sxng_test.sh b/utils/lib_sxng_test.sh index 321584bf2..bd3e19651 100755 --- a/utils/lib_sxng_test.sh +++ b/utils/lib_sxng_test.sh @@ -6,8 +6,9 @@ test.help(){ test.: yamllint : lint YAML files (YAMLLINT_FILES) pylint : lint ./searx, ./searxng_extra and ./tests - pyright : static type check of python sources (.dev or .ci) black : check black code format + shfmt : check shfmt code format + shfmt : check Shell script code format unit : run unit tests coverage : run unit tests with coverage robot : run robot test @@ -105,6 +106,12 @@ test.black() { dump_return $? } +test.shfmt() { + build_msg TEST "[shfmt] ${SHFMT_SCRIPTS[*]}" + go.tool shfmt --list --diff "${SHFMT_SCRIPTS[@]}" + dump_return $? +} + test.unit() { build_msg TEST 'tests/unit' # shellcheck disable=SC2086 |