[CI] Make format checker error message more user-friendly by using emoji (#9564)
This PR makes format checker error message more user-friendly by adding emojis.
This commit is contained in:
parent
711f3a7806
commit
575dcebe9a
24
format.sh
24
format.sh
@ -21,6 +21,20 @@ builtin cd "$(dirname "${BASH_SOURCE:-$0}")"
|
|||||||
ROOT="$(git rev-parse --show-toplevel)"
|
ROOT="$(git rev-parse --show-toplevel)"
|
||||||
builtin cd "$ROOT" || exit 1
|
builtin cd "$ROOT" || exit 1
|
||||||
|
|
||||||
|
check_command() {
|
||||||
|
if ! command -v "$1" &> /dev/null; then
|
||||||
|
echo "❓❓$1 is not installed, please run \`pip install -r requirements-lint.txt\`"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_command yapf
|
||||||
|
check_command ruff
|
||||||
|
check_command mypy
|
||||||
|
check_command codespell
|
||||||
|
check_command isort
|
||||||
|
check_command clang-format
|
||||||
|
|
||||||
YAPF_VERSION=$(yapf --version | awk '{print $2}')
|
YAPF_VERSION=$(yapf --version | awk '{print $2}')
|
||||||
RUFF_VERSION=$(ruff --version | awk '{print $2}')
|
RUFF_VERSION=$(ruff --version | awk '{print $2}')
|
||||||
MYPY_VERSION=$(mypy --version | awk '{print $2}')
|
MYPY_VERSION=$(mypy --version | awk '{print $2}')
|
||||||
@ -31,7 +45,7 @@ CLANGFORMAT_VERSION=$(clang-format --version | awk '{print $3}')
|
|||||||
# # params: tool name, tool version, required version
|
# # params: tool name, tool version, required version
|
||||||
tool_version_check() {
|
tool_version_check() {
|
||||||
if [[ $2 != $3 ]]; then
|
if [[ $2 != $3 ]]; then
|
||||||
echo "Wrong $1 version installed: $3 is required, not $2."
|
echo "❓❓Wrong $1 version installed: $3 is required, not $2."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -281,10 +295,12 @@ tools/actionlint.sh -color
|
|||||||
echo 'vLLM actionlint: Done'
|
echo 'vLLM actionlint: Done'
|
||||||
|
|
||||||
if ! git diff --quiet &>/dev/null; then
|
if ! git diff --quiet &>/dev/null; then
|
||||||
echo 'Reformatted files. Please review and stage the changes.'
|
echo
|
||||||
echo 'Changes not staged for commit:'
|
echo "🔍🔍There are files changed by the format checker or by you that are not added and committed:"
|
||||||
echo
|
|
||||||
git --no-pager diff --name-only
|
git --no-pager diff --name-only
|
||||||
|
echo "🔍🔍Format checker passed, but please add, commit and push all the files above to include changes made by the format checker."
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
echo "✨🎉 Format check passed! Congratulations! 🎉✨"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user