-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Handle relative file paths in compilation database
Let's suppose that we have the following directory stucture: ``` |- .codechecker |- compilation_commands.json |- reports |- main.cpp ``` And all the file paths in the compilation database are relative: ```json [ { "file": "main.cpp", "command": "g++ -c main.cpp -o /dev/null", "directory": "." } ] ``` If we run the `CodeChecker analyze` command on this project, ClangSA analyzer will generate a plist file where the file path will be relative to the directory where the analyzer was called on. After the plist files are produced, report converter will try to post-process these files and creates absolute paths from the relative paths. With this patch now we will create absolute paths based on the following values: - Current directory (`os.getcwd()`) where the CodeChecker command was executed. - The value of the `directory` key from the build action (in the example above it is `.`). - File path in the plist file. If any of the above mentioned values are already absolute paths during the join it will skip the previous values from the file path.
- Loading branch information
1 parent
487b95c
commit a9a0403
Showing
5 changed files
with
82 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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