CPP-7789 Add shared SonarResolve parser to analyzer commons#387
CPP-7789 Add shared SonarResolve parser to analyzer commons#387mostafa-mohammed-sonarsource merged 7 commits intomasterfrom
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
SummaryThis PR moves the The implementation adds:
What reviewers should knowStart reading: The core implementation is in
Key design decisions:
Testing coverage: Test file uses parametrized tests with
Worth reviewing: The escape sequence handling (lines 334-345) and the multi-line accumulation logic—these are the areas most likely to interact with real formatter edge cases.
|
lijun-chen-sonarsource
left a comment
There was a problem hiding this comment.
Thanks for working on this. I personally very much like sonar-resolve as feature, so looking forward to see everything merged and released.
I left some comments. Curious to hear what you think.
commons/src/main/java/org/sonarsource/analyzer/commons/SonarResolve.java
Show resolved
Hide resolved
commons/src/main/java/org/sonarsource/analyzer/commons/SonarResolve.java
Outdated
Show resolved
Hide resolved
commons/src/main/java/org/sonarsource/analyzer/commons/SonarResolve.java
Show resolved
Hide resolved
commons/src/main/java/org/sonarsource/analyzer/commons/SonarResolve.java
Show resolved
Hide resolved
commons/src/main/java/org/sonarsource/analyzer/commons/SonarResolve.java
Show resolved
Hide resolved
commons/src/main/java/org/sonarsource/analyzer/commons/SonarResolve.java
Show resolved
Hide resolved
commons/src/test/java/org/sonarsource/analyzer/commons/SonarResolveTest.java
Show resolved
Hide resolved
commons/src/test/java/org/sonarsource/analyzer/commons/SonarResolveTest.java
Outdated
Show resolved
Hide resolved
* CPP-7901 Make SonarResolve parser case-insensitive * CPP-7901 Fix SonarResolveTest constructor usage * CPP-7902 Support multiple justification delimiters in SonarResolve * CPP-7902 Support multiple justification delimiters in SonarResolve * CPP-7902 Fix SonarResolveTest constructor usage
|




This PR moves the
SonarResolveparser tosonar-analyzer-commonsso it can be reused by other analyzers.The initial implementation was released in CFamily 6.79. The main reason for moving it here is that we now need to improve and share the parsing logic, especially around code-formatting cases that can split or otherwise alter comments across multiple lines and break
sonar-resolvedirectives.This PR adds the shared parser and its tests to analyzer commons so follow-up fixes and enhancements can be implemented once and consumed from a common place. It is consumed in https://github.com/SonarSource/sonar-cpp/pull/6115.