1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:17:34 +00:00

Meta+Utilities: Make pre-commit checks significantly less verbose

When markdown-check is built, it outputs hundreds of lines of "ignoring
this and that link because reasons". This is extremely not helpful when
trying to figure out exactly which check failed on your commit. Also
remove the timing numbers from lint-ci.sh These are just noise and also
don't help to figure out which pre-commit check failed. Ideally the
output on fail should be "[OK]: Check A" for all the passing checks and
"[FAIL] Check N" with the required context for the failed check.
This commit is contained in:
Andrew Kaster 2023-07-25 11:52:06 -06:00 committed by Tim Flynn
parent b284e525f3
commit 5028223c37
2 changed files with 22 additions and 19 deletions

View file

@ -34,8 +34,7 @@ for cmd in \
Meta/lint-prettier.sh \
Meta/lint-python.sh \
Meta/lint-shell-scripts.sh; do
echo "Running ${cmd}"
if time "${cmd}" "$@"; then
if "${cmd}" "$@"; then
echo -e "[${GREEN}OK${NC}]: ${cmd}"
else
echo -e "[${RED}FAIL${NC}]: ${cmd}"
@ -44,8 +43,7 @@ for cmd in \
done
if [ -x ./Build/lagom/bin/IPCMagicLinter ]; then
echo "Running IPCMagicLinter"
if time { git ls-files '*.ipc' | xargs ./Build/lagom/bin/IPCMagicLinter; }; then
if { git ls-files '*.ipc' | xargs ./Build/lagom/bin/IPCMagicLinter; }; then
echo -e "[${GREEN}OK${NC}]: IPCMagicLinter (in Meta/lint-ci.sh)"
else
echo -e "[${RED}FAIL${NC}]: IPCMagicLinter (in Meta/lint-ci.sh)"
@ -55,8 +53,7 @@ else
echo -e "[${GREEN}SKIP${NC}]: IPCMagicLinter (in Meta/lint-ci.sh)"
fi
echo "Running Meta/lint-clang-format.sh"
if time Meta/lint-clang-format.sh --overwrite-inplace "$@" && git diff --exit-code; then
if Meta/lint-clang-format.sh --overwrite-inplace "$@" && git diff --exit-code; then
echo -e "[${GREEN}OK${NC}]: Meta/lint-clang-format.sh"
else
echo -e "[${RED}FAIL${NC}]: Meta/lint-clang-format.sh"
@ -70,8 +67,7 @@ fi
# when Ports/ files have changed and only invoke lint-ports.py when needed.
#
if [ "$ports" = true ]; then
echo "Running Meta/lint-ports.py"
if time Meta/lint-ports.py; then
if Meta/lint-ports.py; then
echo -e "[${GREEN}OK${NC}]: Meta/lint-ports.py"
else
echo -e "[${RED}FAIL${NC}]: Meta/lint-ports.py"