From 3fbe40c9b10ff8fcd47a06a8101526c32e5a59ea Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 13 Aug 2026 19:13:44 -0700 Subject: [PATCH] fix(scripts): print the make check verdict on early informational exits --- scripts/pre_commit_lint.sh | 2 ++ tests/test_litellm/test_pre_commit_lint.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/pre_commit_lint.sh b/scripts/pre_commit_lint.sh index e19012613cd..82498ec10cd 100755 --- a/scripts/pre_commit_lint.sh +++ b/scripts/pre_commit_lint.sh @@ -55,11 +55,13 @@ else merge_base=$(git merge-base origin/litellm_internal_staging HEAD 2>/dev/null) || { echo "check: cannot resolve the merge base with origin/litellm_internal_staging." >&2 echo " Fix: git fetch origin litellm_internal_staging" >&2 + echo "check: FAIL" exit 1 } scope=$(printf '%s\n' "$(git diff --name-only --diff-filter=ACMRD "$merge_base")" "$untracked" | sed '/^$/d' | sort -u) if [ -z "$scope" ]; then echo "check: nothing to check (no staged files, no working-tree changes, no branch changes vs origin/litellm_internal_staging)" + echo "check: PASS" exit 0 fi echo "check: nothing staged; scoping to the working tree's diff against the merge base with origin/litellm_internal_staging:" diff --git a/tests/test_litellm/test_pre_commit_lint.py b/tests/test_litellm/test_pre_commit_lint.py index 7ce16032641..33baf7474ce 100644 --- a/tests/test_litellm/test_pre_commit_lint.py +++ b/tests/test_litellm/test_pre_commit_lint.py @@ -224,6 +224,7 @@ def test_nothing_staged_and_no_changes_is_an_explicit_no_op(tmp_path: Path) -> N proc = _run(repo, bin_dir, {}) assert proc.returncode == 0, proc.stdout + proc.stderr assert "nothing to check" in proc.stdout + assert "check: PASS" in proc.stdout assert "linting Python" not in proc.stdout @@ -234,6 +235,7 @@ def test_nothing_staged_without_a_base_ref_fails_with_a_fetch_hint(tmp_path: Pat assert proc.returncode == 1 assert "cannot resolve the merge base" in proc.stdout assert "git fetch origin litellm_internal_staging" in proc.stdout + assert "check: FAIL" in proc.stdout def test_partial_staging_warns_which_checks_were_skipped(tmp_path: Path) -> None: