Skip to content

Conversation

@vamsipolavarapu-msft
Copy link

Fix related to XML suppressions not working (#588).

Changes:

  • Added xml suppression comments syntax requirements in comments.json
  • Added a test class for testing suppression comments. File: DevSkimRuleProcessorTests.cs

Changes:
- Added xml suppression comments syntax requirements in comments.json
- Added a test class for testing suppression comments. File: DevSkimRuleProcessorTests.cs
@gfs
Copy link
Contributor

gfs commented Oct 14, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@vamsipolavarapu-msft
Copy link
Author

Sample XML suppression
image

@danfiedler-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@gfs gfs requested a review from Copilot October 22, 2025 18:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where XML suppression comments were not working in DevSkim. The fix adds XML-specific comment syntax definitions and introduces comprehensive test coverage for suppression functionality across multiple languages.

Key changes:

  • Added XML comment syntax (<!-- -->) to the comments configuration
  • Created new test class DevSkimRuleProcessorTests.cs with unit tests for suppression generation across various languages
  • Enhanced existing SuppressionsTest.cs with integration tests specifically for XML suppressions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
DevSkim-DotNet/Microsoft.DevSkim/resources/comments.json Added XML comment syntax definition with prefix <!-- and suffix -->
DevSkim-DotNet/Microsoft.DevSkim.Tests/SuppressionsTest.cs Added XML-specific integration tests and TestContext property
DevSkim-DotNet/Microsoft.DevSkim.Tests/DevSkimRuleProcessorTests.cs New test class covering suppression generation for multiple languages including XML

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gfs
Copy link
Contributor

gfs commented Oct 22, 2025

This looks like it'd be the correct way to specify this to me. The test failures I think are a pipeline permission issue, maybe some setting needs to be updated?

@vamsipolavarapu-msft
Copy link
Author

vamsipolavarapu-msft commented Oct 22, 2025

This looks like it'd be the correct way to specify this to me. The test failures I think are a pipeline permission issue, maybe some setting needs to be updated?

Yes, the assert statements are in the correct format. And Dan is checking on the pipeline permissions issue. I cleaned up the other unused test method as well.

@gfs
Copy link
Contributor

gfs commented Oct 22, 2025

@vamsipolavarapu-msft To be able to merge you need to accept the CLA and also add an update to the changelog to satisfy the CI check.

@vamsipolavarapu-msft
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

Enabling suppressions for XML files to address bug microsoft#588.
@gfs
Copy link
Contributor

gfs commented Oct 22, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

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.

4 participants