File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,12 +255,12 @@ run_phpstan() {
255255
256256 if [[ $exit_code -ne 0 ]]; then
257257 echo " Error: PHPStan failed at level ${level} with exit code ${exit_code} " >&2
258- exit 1
258+ return 1
259259 fi
260260
261261 if [[ ! -f " $baseline_file " ]]; then
262262 echo " Error: Baseline file was not created at ${baseline_file} " >&2
263- exit 1
263+ return 1
264264 fi
265265
266266 echo " Successfully generated: ${baseline_file} "
@@ -272,15 +272,24 @@ cleanup_temp_files() {
272272trap cleanup_temp_files EXIT INT TERM
273273
274274# Main loop
275+ FAILED_LEVELS=" "
275276if [[ " $GENERATE " == " true" ]]; then
276277 for level in $( seq $LEVEL_START $LEVEL_END ) ; do
277278 config=$( generate_temp_config $level )
278- run_phpstan $level " $config "
279+ if ! run_phpstan $level " $config " ; then
280+ FAILED_LEVELS=" $FAILED_LEVELS $level "
281+ fi
279282 rm -f " $config "
280283 done
281284fi
282285
283286capture_after_counts
284287display_summary_table
285288
289+ if [[ -n " $FAILED_LEVELS " ]]; then
290+ echo " " >&2
291+ echo " Error: Generation failed for levels:$FAILED_LEVELS " >&2
292+ exit 1
293+ fi
294+
286295exit 0
You can’t perform that action at this time.
0 commit comments