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

How to supress a warning in the next line #625

Open
josecelano opened this issue Aug 8, 2024 · 1 comment
Open

How to supress a warning in the next line #625

josecelano opened this issue Aug 8, 2024 · 1 comment

Comments

@josecelano
Copy link

Relates to: #114

I don't see in the docs how to suppress a warning in the next line:

https://github.com/microsoft/DevSkim/wiki/Suppressions

@gfs
Copy link
Contributor

gfs commented Aug 12, 2024

Hi @josecelano,

Thanks for the feedback. I don't think this is a feature we support currently. The 2019 version of the extension is quite different to the most recent version where findings and suppressions are generated with the C# library.

This seems like a reasonable request for a feature add, I think with the refactor its relatively easy to integrate this, though I don't have an estimate right now when we can get to it.

As a note for future implementor, I think this just requires modifying the protected ParseLine method in the Suppression.cs class or the constructor of Suppression to check the line previous to the particular line as well as the line itself. It also requires check for a suppression comment with a slightly different style, perhaps DevSkim: ignore-next-line instead of DevSkim: ignore, to distinguish when the suppression is intended for a subsequent line instead of the current line. As well as new suppression test cases and new documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants