-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #13333 (better handling when source file is repeated in compile_commands.json) #7508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
More tests are needed.. however when I run it manually I see improvement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the handling of duplicate file entries in compile_commands.json (Fix #13333). Key changes include passing a new fileIndex parameter through various API functions and updating test cases to validate correct ordering and naming of duplicate files.
- Updated file handling in Summaries, Tokenizer, AnalyzerInformation, and cppcheck to include a fileIndex.
- New tests added in testimportproject.cpp, testanalyzerinformation.cpp, and dumpfile_test.py to verify duplicate file scenarios.
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
test/testsummaries.cpp | Adjusted Summaries::create call to pass a file index. |
test/testimportproject.cpp | Added support and tests for handling duplicate file entries. |
test/testanalyzerinformation.cpp | Updated analyzer information tests to check the new file index in file names. |
test/cli/dumpfile_test.py | Added new test to verify dump file naming for duplicate source files. |
lib/tokenize.h/.cpp | Updated simplifyTokens1 to accept a file index parameter. |
lib/summaries.h/.cpp | Propagated fileIndex parameter to create analyzer info filenames. |
lib/importproject.cpp | Integrated fileIndex mapping while importing compile commands. |
lib/filesettings.h | Introduced fileIndex member. |
lib/cppcheck.h/.cpp | Updated checkFile and checkClang functions to accept fileIndex. |
lib/analyzerinfo.h/.cpp | Modified analyzer info file creation and parsing to include fileIndex. |
gui/checkthread.cpp | Updated AnalyzerInformation call with the proper file index. |
Files not reviewed (1)
- Makefile: Language not supported
No description provided.