Repository navigation
php/phpstan, php/phpcs: fail when the tool finds errors in send-to-file mode - #53
Merged
Merged
Conversation
…e mode Both targets appended '|| true' after the output redirect, so 'make php/phpstan/analyse' and 'make php/phpcs/check' exited 0 whether the tool passed or found errors; the output file was the only signal. Keep the redirect, drop the swallow, so the exit code matches the non-file path. Fixes #52.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52.
make php/phpstan/analyseandmake php/phpcs/checkappended|| trueafter the output redirect in send-to-file mode, so the target exited 0 whether the tool passed or found errors — the output file was the only signal, and nothing about a target namedanalyse/checksays so.Change
modules/php/phpstan/phpstan.mk:36andmodules/php/phpcs/phpcs.mk:38: keep the> file 2>&1redirect, drop|| true. The exit code now propagates, matching the non-file path.Verification
Proof in #52 (probe file with a return-type error → exit 0 +
[ERROR] Found 1 error; removed → exit 0 +[OK]). After this change the same probe makes the target exit non-zero while the output file still holds the report. Behaviour on the non-file path is unchanged.Consumer note
CI in the consuming repos calls phpstan directly and was never masked; what this fixes is anyone running the make target and trusting
$?. In compression_api phpcs runs nowhere else, so that target was the only gate and could not fail.