Conversation
d7024a3 to
83d2ec1
Compare
dkrupp
left a comment
There was a problem hiding this comment.
Looks good, but
can you pls add a testcase with relative path in the compile_commands.json?
The parse status file filter now correctly handles relative file paths in the compile_commands.json file. Additonally, a bug was fixed when the filter was used for nonexistent files.
83d2ec1 to
ba0fac8
Compare
| if invalid_file_filter: | ||
| LOG.error("File filter (--file) contains nonexistent files:") | ||
| LOG.error(invalid_file_filter) | ||
| sys.exit(1) |
There was a problem hiding this comment.
What is the purpose of checking the existence of the file? I think, it can be a valid scenario to ask the users to send me their report folder and I make some queries about their analyzed files on my machine where the project code is not available.
There was a problem hiding this comment.
In general, we assume the report_dir/ and the source files are on the same system.
Typical use case for the --status command with --file option is to check whether a local file has been analysed or not. This is also used heavily in the VSCode plugin. Moreover, we would also like to know if a file has been recently analyzed or outdated, thus we check the modification time of the local source file in function get_report_dir_status. If the modification time of the source file is more recent than the creation of the report_dir/, we consider the analysis status outdated.
This all assumes the report directory and the source files are on the same system. If this is the case, it is pointless to use the --file filter on a nonexisting file, thus an error was added.
I think, it can be a valid scenario to ask the users to send me their report folder and I make some queries about their analyzed files on my machine where the project code is not available.
While this is valid, I believe this is a separate use case. As an alternative, maybe we could add a flag like --ignore-nonexisting-files or something like that. But in the above case, we should at least somehow inform the user that they tried to query analysis information of non-existing files.
The parse status file filter now correctly handles relative file paths in the compile_commands.json file. Additonally, a bug was fixed when the filter was used for nonexistent files.