From f25059d1593126cb82f859759fac71a2efc8a508 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 29 Nov 2024 17:20:38 +0100 Subject: [PATCH] shfmt --- sh/main.sh | 5 ++++- sh/shellcheck.sh | 1 - sh/shfmt.sh | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 sh/shfmt.sh diff --git a/sh/main.sh b/sh/main.sh index 92b9601..7d85c49 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -132,7 +132,10 @@ rwx_main() { sh_source_directory "${SH_USER}" # run interactive extras if sh_shell_interactive; then - # check + # check format + sh_log + rwx_shfmt "${SH_ROOT}" + # check syntax sh_log rwx_shellcheck_check "${SH_ROOT}" # help diff --git a/sh/shellcheck.sh b/sh/shellcheck.sh index 703b21d..df2c02d 100644 --- a/sh/shellcheck.sh +++ b/sh/shellcheck.sh @@ -6,7 +6,6 @@ rwx_shellcheck_check() { _sh_ifs_new for module in ${modules}; do path="${root}/${module}" - shfmt --diff "${path}" echo ". \"${path}\"" >>"${file}" done _sh_ifs_pop diff --git a/sh/shfmt.sh b/sh/shfmt.sh new file mode 100644 index 0000000..107170b --- /dev/null +++ b/sh/shfmt.sh @@ -0,0 +1,4 @@ +rwx_shfmt_check() { + local root="${1}" + shfmt --diff "${root}" +}