Syntax errors not being shown when error_prepend_string is set #1260
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.
Syntax errors were not being matched if the
php.ini
file used contained a value forerror_prepend_string
.This fix makes double sure that those will now start showing up as it:
error_prepend_string
will normally be on its own line in the output, so matching the error pattern for each line should prevent further issues.Unit testing this would be near impossible as one would need to overload the
php.ini
file used by the linting process.All the same, the issue can easily be reproduced:
php.ini
file for the PHP version on which PHPCS is running, uncomment it and give it a value. Example often used by people mainly using PHP in the browser:<span style='color: #ff0000'>
(combined witherror_append_string = "</span>"
).[Edit]: Recommitted to fix HHVM build failure.