Skip to content
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

When printing analysis messages to the console, separate the texttual… #208

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Feb 18, 2024

… description from the rest with a ':' instead of '-'

Context:
I've been trying to get the analyzer results integrated into a CI build at work, which is running in Azure DevOps.

I've got the SARIF results file being consumed by the MS SAST scans tab DevOps extension, and that appears to be working nicely.
However, I though it might be nice if the results could be displayed as regular build warnings as well as in the sarif, so they just display in the main build output instead of you having to look at a different tab to see issues.

I couldn't get the results to show up as warnings, but then noticed that the analysers CLI tool currently outputs the results to the console with the final field separated from the rest with a - rather than the usual : and it does seem that changing that causes the output to be recognised as warnings (complete with yellow text output rather than white).

Is this a reasonable change to make?

… description from the rest with a ':' instead of '-'
@Numpsy Numpsy changed the title When printing analysis messages to the console, separate the textutal… When printing analysis messages to the console, separate the texttual… Feb 18, 2024
@Numpsy
Copy link
Contributor Author

Numpsy commented Feb 18, 2024

Note: I haven't been able to run the unit tests locally due to the issue I mentioned at #182 (comment)

@baronfel
Copy link
Collaborator

Would you mind adding a screen shot of the before and after that you see in your CI?

@Numpsy
Copy link
Contributor Author

Numpsy commented Feb 18, 2024

If I run my fun.build script with the current analyzers sdk version, I get this:

image

and with the modification I get this:

image

Also If I enable a binlog in the build, I now get warnings shown in the log:

image

whereas before I only had messages:

image

refs this 'determine what's a warning by pattern matching' behaviour in MSBuild I think? https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-diagnostic-format-for-tasks?view=vs-2022

@baronfel
Copy link
Collaborator

perfect, that's what I expected the cause to be - the SDK is now emitting errors matching the MSBuild Canonical Error Format.

@baronfel baronfel merged commit fbe5cbc into ionide:main Feb 18, 2024
2 checks passed
@Numpsy Numpsy deleted the semi_colon_sep branch February 18, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants