From 9b78630b1c5d22d8634f18808a194d1ff671f13a Mon Sep 17 00:00:00 2001 From: linsui <2873532-linsui@users.noreply.gitlab.com> Date: Thu, 19 Sep 2024 17:52:27 +0800 Subject: [PATCH] CI: show white spaces and line ending in lint diff --- .gitlab-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 868e7583de..4f804bd328 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -144,14 +144,14 @@ fdroid lint: - function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; } - | if [ -n "$CHANGED" ]; then - fdroid lint -f $CHANGED || { - set_error; - printf "\nThese files have lint issues:\n"; - fdroid rewritemeta -l $CHANGED; - printf "\nThese are the formatting issues:\n"; - fdroid rewritemeta $CHANGED; - git --no-pager diff --color=always; - } + fdroid rewritemeta $CHANGED; + git diff --exit-code > /dev/null || { + set_error; + printf "\nThese files have lint issues:\n"; + git diff --name-only; + printf "\nThese are the formatting issues:\n"; + printf "$(git --no-pager diff --color=always --ws-error-highlight=all | sed 's/\r/^M/')"; + } fi - exit $EXITVALUE