How to locally suppress issues while analysis of XML files?

If a C# rule is not “valid” in a specific class it can be disabled locally using SuppressMessageAttribute or #pragma warning ....

How to locally suppressed in XML files?

Hi @lg2de,

See FAQ, try //NOSONAR at the end of the line in the XML file. See if that works for you.

Joe

1 Like

With “//NOSONAR” I can suppress ALL issues on that line.
Is it possible to suppress SINGLE issue for ALL (following) lines in an XML file?

Thanks
Lukas

Hello @lg2de ,

In order to remove the issue from a given rule on ALL the lines in XML files, I would recommend you to:

  • disable the rule itself
  • Narrow the focus, and manually exclude the rule for a file, using your project configuration. More here:

https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/

Hope this helps,
Michael

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.