Is your feature request related to a problem? Please describe.
scripts/static_checks.sh is the local "run all checks" convenience script. However, when an individual check fails (e.g., ktlint_lint_check.sh exits with code 1), the outer script currently continues running the next check and ultimately exits with the status of the last command, not the first failure. This means a developer could see "finished" at the end while a check in the middle silently failed.
The fix is to track failures across all checks and exit with a non-zero code if any of them failed, matching CI behavior.
Describe the solution you'd like
Update scripts/static_checks.sh to track failures across all checks and exit with a non-zero code if any of them failed, while still running all checks to completion (not bailing on the first failure).
Concretely:
- Add a
FAILURES=0 counter at the top of the script.
- After each check invocation, append
|| FAILURES=$((FAILURES+1)) to capture failures without stopping execution.
- At the very end of the script, exit with a non-zero code if
FAILURES > 0 and print a clear summary, e.g.:
2 check(s) failed. Please fix the above errors.
All checks passed.
This matches how CI behaves: all checks run, and the job reports overall failure if any individual step failed.
Describe alternatives you've considered
Using set -e at the top of the script would bail on the first failure and skip remaining checks, which is worse UX for a developer who wants to fix all issues in one pass. The failure-counter approach is strictly better.
Additional context
Files involved:
scripts/static_checks.sh (only file that needs to change)
The fix is ~10 lines of Bash. A contributor can verify correctness by:
- Introducing a deliberate lint error (e.g. a trailing space in a .kt file).
- Running
bash scripts/static_checks.sh.
- Confirming the script completes all remaining checks AND exits with code 1.
Related: scripts/pre-push.sh already has a similar pattern worth referencing.
Is your feature request related to a problem? Please describe.
scripts/static_checks.shis the local "run all checks" convenience script. However, when an individual check fails (e.g.,ktlint_lint_check.shexits with code 1), the outer script currently continues running the next check and ultimately exits with the status of the last command, not the first failure. This means a developer could see "finished" at the end while a check in the middle silently failed.The fix is to track failures across all checks and exit with a non-zero code if any of them failed, matching CI behavior.
Describe the solution you'd like
Update
scripts/static_checks.shto track failures across all checks and exit with a non-zero code if any of them failed, while still running all checks to completion (not bailing on the first failure).Concretely:
FAILURES=0counter at the top of the script.|| FAILURES=$((FAILURES+1))to capture failures without stopping execution.FAILURES > 0and print a clear summary, e.g.:2 check(s) failed. Please fix the above errors.All checks passed.This matches how CI behaves: all checks run, and the job reports overall failure if any individual step failed.
Describe alternatives you've considered
Using
set -eat the top of the script would bail on the first failure and skip remaining checks, which is worse UX for a developer who wants to fix all issues in one pass. The failure-counter approach is strictly better.Additional context
Files involved:
scripts/static_checks.sh(only file that needs to change)The fix is ~10 lines of Bash. A contributor can verify correctness by:
bash scripts/static_checks.sh.Related:
scripts/pre-push.shalready has a similar pattern worth referencing.