Repository navigation
Do not assign in the if condition of ParserRunner::parse() - #7135
Merged
Merged
Conversation
clang-tidy's bugprone-assignment-in-if-condition fails Turbo Extension Lint since the native Php7 parser. The tables are still prepared only for a string input.
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.
Since
c9f7d8928("Turbo: native Php7 parser"), the Turbo Extension Lint check (make lint-turbo, clang-tidy 21) fails on 2.3.x. It's red ondfdb69d12,061d99163and HEAD29163709a:7e86b9ecf(Turbo Extension Lint passed).c9f7d8928. It was pushed together withdfdb69d12, the first commit whose lint run failed, andgit blameputs line 1275 in it.Fix. The parser tables are now prepared in the declaration, and only for a string input as before, so the
ifonly tests the result. Nothing else changes. Perturbo-ext/CLAUDE.mdthe finding is fixed rather than silenced or excluded.Verification (local, clang-tidy 21 as pinned):
clang-tidy-21 -p . src/parser/ParserRunner.cppreports the CI error. After it,make lint-turboover every source exits 0.-Werrorwarning flags) andmake build-turbopass.tests/smoke.php:ALL OK.tests/signature-parity.php:OK (18526 members compared).tests/parser-corpus.php: 19032 files, 0 failed.tests/parser-upstream-corpus.php: 524 php-parser cases, 0 failed.Only the native extension changes, not PHP code shipped in the PHAR, so the downgraded PHAR's PHP 7.4 compatibility is unaffected.