-
Notifications
You must be signed in to change notification settings - Fork 540
Add support for sarif output files. #1617
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
base: master
Are you sure you want to change the base?
Conversation
Only msvc was tested, worked for simply example.
d13dc2d to
a13c1d4
Compare
| args_info.output_sarif = args_info.input_file; | ||
| args_info.output_sarif.append(".sarif"); |
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.
Apparently, this is not how GCC decides where to write sarif data. See my suggested update of the test case in a comment below.
| using namespace std::string_view_literals; | ||
| auto param = std::string_view(arg).substr("-fdiagnostics-format="sv.size()); | ||
| if (param == "sarif-file") { | ||
| args_info.generating_sarif = true; |
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.
Since the sarif file includes CWD we should set state.hash_actual_cwd = true here.
Co-authored-by: Joel Rosdahl <[email protected]>
Only msvc was tested, worked for simply example.
Fixes #1614 and #1466.
Open questions that I have not looked at:
Should we "rewrite" the arguments like done for other options?