Fix check_style.sh regex patterns to properly detect style issues
#16423
+8
−8
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.
While working on #16266, I noticed that some style issues were not being caught by our script. This PR fixes issues in
check_style.shthat were causing:grepwarnings due to invalid or unnecessary regex syntax when using the Extended Regular Expressions (-E) optionThe old patterns
^* [*]and^*//.*were flagged as invalid regex bygrep(i.e.,*at start of expression) and inadvertently matched any line containing*(space followed by asterisk). This caused real pointer alignment issues likeCFGNode *_nodeto be excluded from detection.The new pattern
:[0-9]+:\s*\*\sonly excludes comment continuation lines (where the source starts*followed by whitespace), allowing real style violations to be properly detected.I also changed
\/(\/|\*)to/[/*]. Forward slashes are not special characters in regular expressions and do not need escaping. The unnecessary escaping was causinggrep: warning: stray \ before /to appear in the script output.