From d7a025cb91db5df4cf011445991231848b213842 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Sat, 15 Aug 2020 13:17:45 +0800 Subject: [PATCH] [pretty] shfmt only git files (#5395) --- script/make-pretty | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/make-pretty b/script/make-pretty index 9129ed81d..6df008405 100755 --- a/script/make-pretty +++ b/script/make-pretty @@ -133,7 +133,7 @@ do_shell_format() echo -e ' format shell' echo -e '=====================' - shfmt -f . | grep -v -E "^($(echo "${OT_EXCLUDE_DIRS[@]}" | tr ' ' '|'))" \ + git ls-files | xargs shfmt -f | grep -v -E "^($(echo "${OT_EXCLUDE_DIRS[@]}" | tr ' ' '|'))" \ | xargs -n10 -P"$OT_BUILD_JOBS" shfmt -i 4 -bn -ci -fn -s -w } @@ -143,10 +143,10 @@ do_shell_check() echo -e ' check shell' echo -e '=====================' - shfmt -f . | grep -v -E "^($(echo "${OT_EXCLUDE_DIRS[@]}" | tr ' ' '|'))" \ + git ls-files | xargs shfmt -f | grep -v -E "^($(echo "${OT_EXCLUDE_DIRS[@]}" | tr ' ' '|'))" \ | xargs -n10 -P"$OT_BUILD_JOBS" shfmt -i 4 -bn -ci -fn -s -d - shfmt -f . | grep -v -E "^($(echo "${OT_EXCLUDE_DIRS[@]}" | tr ' ' '|'))" \ + git ls-files | xargs shfmt -f | grep -v -E "^($(echo "${OT_EXCLUDE_DIRS[@]}" | tr ' ' '|'))" \ | xargs -n10 -P"$OT_BUILD_JOBS" shellcheck }