Only analyze files that are contained in the 'JSON Compilation Database'#2430
Merged
guwirth merged 1 commit intoSonarOpenCommunity:masterfrom Nov 15, 2022
Merged
Only analyze files that are contained in the 'JSON Compilation Database'#2430guwirth merged 1 commit intoSonarOpenCommunity:masterfrom
guwirth merged 1 commit intoSonarOpenCommunity:masterfrom
Conversation
In case of 'sonar.cxx.jsonCompilationDatabase' is used, limit the analyzed files to the files contained in the 'JSON Compilation Database' file. The sensor is an intersection of the files configured via 'sonar.projectBaseDir' and the files contained in the 'JSON Compilation Database' file. In the past, all files configured via 'sonar.projectBaseDir' were always analyzed and only the configuration (INCLUDES, MACROS) was read from the 'JSON Compilation Database'. - filter 'sonar.sources' files - add a JSON Compilation Database support integration test
Collaborator
Author
|
@thyros and @Kinokin there is another improvement for the Json Compilation Database sensor. Maybe you can try it and give feedback. https://github.com/SonarOpenCommunity/sonar-cxx/suites/8897425714/artifacts/407082091 |
|
Well, this may break our analysis. Just a few days ago we re-enabled sonar-cxx scanning after
Unity build looks like unity_lib.cpp: Filtering by compilation database will drop all source_*.cpp files now. |
Collaborator
Author
|
Hi @Kinokin, currently there is no option but we can add one. # default False
sonar.cxx.jsonCompilationDatabase.analyzeOnlyContainedFiles=True/FalseWhat do you think? Regards |
|
Yes, this would be sufficient, thanks! |
Collaborator
Author
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.
In case of
sonar.cxx.jsonCompilationDatabaseis used, limit the analyzed files to the files contained in the 'JSON Compilation Database' file. The sensor is an intersection of the files configured viasonar.projectBaseDirand the files contained in the 'JSON Compilation Database' file.In the past, all files configured via
sonar.projectBaseDirwere always analyzed and only the configuration (INCLUDES, MACROS) was read from the 'JSON Compilation Database'.sonar.projectBaseDirfiles resultHint: Unfortunately, the sensor cannot control the indexing of the source files. Therefore, all files that belong to language CXX and are located within the directory
sonar.projectBaseDirare loaded onto the server, but are no longer analyzed, which saves time.This change is