-
Notifications
You must be signed in to change notification settings - Fork 115
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
VSCode should surface BestPractice
or ManualReview
severity rules in problems window
#670
Comments
Ok, I'm sorry but I don't get a blue icon in VScode like in my first screenshot. Only confidence has a low option. The confidence has nothing to do with the icon? Severity has critical and important which are both a red icon. And moderate which is yellow. No low severity option. Also ManualReview and BestPractice (apparently a severity) enabled don't turn into a blue icon either. |
Low is not a valid value for the Severity enum: The matches do show up with intellisense when enabled but do not show up in the problems window: I think this is because we map DevSkim/DevSkim-DotNet/Microsoft.DevSkim.LanguageServer/TextDocumentSyncHandler.cs Lines 122 to 134 in 210b5d1
According to the VSCode documentation for the enum values,
Once populated by the LSP its up to VS Code to decide how to surface the results, and it seems that for hints they do not populate them in the problems window. Perhaps one of these severities would work better as |
severity: low
BestPractice
or ManualReview
severity rules in problems window
I see, thank you for further investigating and reopening. Having these exact and consistent possible values defined in the proposed JSON Schema would really help here too. As well as documenting the exact mapping. I propose two solutions, which either way I think should be documented in this mapping table that documents mapping between DevSkim and Sarif, it should add a column with the VSCode mapping. Which should be consistent with the Sarif standard '3.27.10 level property 'too. Meaning sarif severity none should be mapped too. Which fits DevSkim Unspecified. I'd almost ask why not just use only the four 'Enumeration DiagnosticSeverity' levels Error/Warning/Information/Hint. Beyond VSCode I don't use DevSkim, so I don't exactly know in what context ManualReview and Best-Practise (btw yet another writing style in VSCode docs) are used, but I can imagine they are other use cases outside VSCode as well the importance of maintaining backwards combability. Proposed solution 1 (change ManualReview/BestPractise to Information instead of Hint) and add Sarif None:
Proposed solution 2 (introduce Low and add Sarif None):
Either solution would only affect the VSCode extension and won't affect existing rules. However the second solution won't show existing rules without re-evaluating in VSCode. I would very much prefer solution 1. |
I think its reasonable to update that table with the diagnostic severity mappings as well.
While the intention of Best Practice can roughly map to |
I'd make a PR but I never wrote CS and won't know how to test it, so probably a bad idea. If you want I can work on a documentation PR but I would like to finish the JSON schema because that makes things a lot easier. |
Describe the bug
Only hits from custom rules with
severity: moderate
andseverity: critical
show up in VS code.To Reproduce
All are selected:
The problems tab shows low/note problems from other linters but not from DevSkim:
Expected behavior
severities: critical (red), moderate (yellow), low (blue). And a fallback to blue for unsupported keys because otherwise they won't show at all in VScode.
Versions(please complete the following information):
Additional context
I tried the others I found, none show a blue I icon at note/low level:
The text was updated successfully, but these errors were encountered: