aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorIvan Zorin <[email protected]>2023-07-21 07:47:16 +0300
committerGitHub <[email protected]>2023-07-21 14:47:16 +1000
commit52dd27cc07b5361a0ae16289d623759f01118cc2 (patch)
tree360a3cbe933be7f334986468581f69dab461df98 /scripts
parent1c9d3940ca45e2aec9394158fd8aaa1e92b1cd73 (diff)
downloadIronOS-52dd27cc07b5361a0ae16289d623759f01118cc2.tar.gz
IronOS-52dd27cc07b5361a0ae16289d623759f01118cc2.zip
Fix github CI clang-format related check_c-cpp job (#1752)
* Fix github CI clang-format related check_c-cpp job * shellcheck fix
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/deploy.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/deploy.sh b/scripts/deploy.sh
index 56db72df..97fd0c74 100755
--- a/scripts/deploy.sh
+++ b/scripts/deploy.sh
@@ -95,9 +95,12 @@ check_style_file()
# * https://clang.llvm.org/docs/ClangFormatStyleOptions.html#insertbraces
# - since reference env is alpine 3.16 with clang-format 13, implement custom parser to do the similar thing here with grep:
# it used to trace missing { and } for if/else/do/while/for BUT IT'S VERY SPECULATIVE, very-very hacky & dirty.
- test -z "${LIST}" || silent_opt="-q"
- # if file is problematic but filename only requested make final grep in pipe silent ...
- grep -H -n -e "^ .*if .*)$" -e "^ .*else$" -e "^ .* do$" -e "^ .*while .*)$" -e "^ .*for .*)$" "${src}" | grep -v -e "^.*//" -e "^.*:.*: .*if ((.*[^)])$" | sed 's,^,\n\n,; s,: ,:1: error: probably missing { or } for conditional or loop block:\n>>>,;' | grep "${silent_opt}" -e "^.*$"
+ # - if file is problematic but filename only requested make final grep in pipe silent ... UPD: make code messy but shellcheck happy
+ if [ -z "${LIST}" ]; then
+ grep -H -n -e "^ .*if .*)$" -e "^ .*else$" -e "^ .* do$" -e "^ .*while .*)$" -e "^ .*for .*)$" "${src}" | grep -v -e "^.*//" -e "^.*:.*: .*if ((.*[^)])$" | sed 's,^,\n\n,; s,: ,:1: error: probably missing { or } for conditional or loop block:\n>>>,;' | grep -e "^.*$"
+ else
+ grep -H -n -e "^ .*if .*)$" -e "^ .*else$" -e "^ .* do$" -e "^ .*while .*)$" -e "^ .*for .*)$" "${src}" | grep -v -e "^.*//" -e "^.*:.*: .*if ((.*[^)])$" | sed 's,^,\n\n,; s,: ,:1: error: probably missing { or } for conditional or loop block:\n>>>,;' | grep -q -e "^.*$"
+ fi;
if [ "${?}" -ne 1 ]; then
# ... and only print the filename
test -z "${LIST}" || echo "${src}"