Skip to content

Allowing to skip tests with 'SuppressMessageAttribute'#178

Merged
gaelcolas merged 3 commits intodsccommunity:mainfrom
raandree:fix/AllowSuppressMessageAttribute
Jan 23, 2026
Merged

Allowing to skip tests with 'SuppressMessageAttribute'#178
gaelcolas merged 3 commits intodsccommunity:mainfrom
raandree:fix/AllowSuppressMessageAttribute

Conversation

@raandree
Copy link
Copy Markdown
Contributor

@raandree raandree commented Jan 23, 2026

Pull Request (PR) description

Added tag AllowSuppressMessageAttribute to test Should not suppress the required rule to allow usage of SuppressMessageAttribute #135.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the file CHANGELOG.md.
    Entry should say what was changed and how that affects users (if applicable), and
    reference the issue being resolved (if applicable).
  • Documentation added/updated in README.md.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

Walkthrough

Documentation and test metadata updates: added guidance for AllowSuppressMessageAttribute in CHANGELOG.md and README.md, and added the AllowSuppressMessageAttribute test tag in PSSAResource.common.v5.Tests.ps1 to allow excluding the suppression validation for specific cases.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added a "Fixes" subsection under Unreleased documenting the addition of the AllowSuppressMessageAttribute tag and referencing issue #135.
Documentation
README.md
Added explanatory text describing SuppressMessageAttribute validation and how to exclude the test via the AllowSuppressMessageAttribute tag, with examples for build.yaml and Invoke-Pester. (Content appears duplicated in the diff.)
Test Metadata
source/Tests/QA/PSSAResource.common.v5.Tests.ps1
Added the AllowSuppressMessageAttribute tag to the test metadata for "Should not suppress the required rule"; no logic or assertion changes.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding the AllowSuppressMessageAttribute tag to enable suppression of PSScriptAnalyzer rules in tests.
Description check ✅ Passed The description clearly explains the change, references the specific test affected, mentions the AllowSuppressMessageAttribute tag, and links to issue #135.
Linked Issues check ✅ Passed The PR directly addresses issue #135 by adding the AllowSuppressMessageAttribute tag to permit SuppressMessageAttribute usage in tests, matching the requirement to allow suppression of PSScriptAnalyzer rules.
Out of Scope Changes check ✅ Passed All changes (CHANGELOG.md, README.md, and test tagging) are directly related to implementing the AllowSuppressMessageAttribute feature to resolve issue #135.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 10-12: Change the changelog section header from "### Fixes" to
"### Fixed", update the issue link to the format "[issue
`#135`](https://github.com/dsccommunity/DscResource.Test/issues/135)", and reflow
the bullet text about adding tag `AllowSuppressMessageAttribute` to the test
"Should not suppress the required rule" so no line exceeds 80 characters; ensure
the updated bullet reads clearly and is wrapped into multiple lines under the
corrected "### Fixed" header.

In `@README.md`:
- Around line 1177-1206: Wrap the prose in the "Skipping tests that validate
SuppressMessageAttribute usage" section so no line exceeds 80 characters;
specifically reflow the paragraph that starts with "The test `Should not
suppress the required rule` validates..." and the subsequent example blocks and
paragraphs (including the `AllowSuppressMessageAttribute` tag mentions and both
example code blocks) to lines ≤80 characters while preserving Markdown structure
and inline code/backticks.

Comment thread CHANGELOG.md Outdated
Comment on lines +10 to +12
### Fixes

- Added tag `AllowSuppressMessageAttribute` to test `Should not suppress the required rule` to allow usage of `SuppressMessageAttribute` [#135](https://github.com/dsccommunity/DscResource.Test/issues/135).
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Align changelog section name and issue link format; wrap line length.

Use ### Fixed (Keep a Changelog), format issue links as [issue #135](...), and wrap the long line to ≤80 chars.

📄 Proposed fix
-### Fixes
+### Fixed

-- Added tag `AllowSuppressMessageAttribute` to test `Should not suppress the required rule` to allow usage of `SuppressMessageAttribute` [`#135`](https://github.com/dsccommunity/DscResource.Test/issues/135).
+- Added tag `AllowSuppressMessageAttribute` to test `Should not suppress the
+  required rule` to allow usage of `SuppressMessageAttribute`
+  [issue `#135`](https://github.com/dsccommunity/DscResource.Test/issues/135).

As per coding guidelines, …

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Fixes
- Added tag `AllowSuppressMessageAttribute` to test `Should not suppress the required rule` to allow usage of `SuppressMessageAttribute` [#135](https://github.com/dsccommunity/DscResource.Test/issues/135).
### Fixed
- Added tag `AllowSuppressMessageAttribute` to test `Should not suppress the
required rule` to allow usage of `SuppressMessageAttribute`
[issue `#135`](https://github.com/dsccommunity/DscResource.Test/issues/135).
🤖 Prompt for AI Agents
In `@CHANGELOG.md` around lines 10 - 12, Change the changelog section header from
"### Fixes" to "### Fixed", update the issue link to the format "[issue
`#135`](https://github.com/dsccommunity/DscResource.Test/issues/135)", and reflow
the bullet text about adding tag `AllowSuppressMessageAttribute` to the test
"Should not suppress the required rule" so no line exceeds 80 characters; ensure
the updated bullet reads clearly and is wrapped into multiple lines under the
corrected "### Fixed" header.

Comment thread README.md
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79%. Comparing base (502b6ee) to head (ad1f45f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #178   +/-   ##
===================================
  Coverage    79%    79%           
===================================
  Files        43     43           
  Lines       569    569           
===================================
  Hits        452    452           
  Misses      117    117           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@gaelcolas gaelcolas left a comment

Choose a reason for hiding this comment

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

ok now!
Thanks :)

Comment thread CHANGELOG.md Outdated

## [Unreleased]

### Fixes
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fixed is the correct term in Keepachangelog format.

Comment thread README.md
@gaelcolas gaelcolas merged commit 5efd59f into dsccommunity:main Jan 23, 2026
11 checks passed
@raandree raandree deleted the fix/AllowSuppressMessageAttribute branch January 23, 2026 18:35
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.

How to suppress a PSScriptAnalyzer rule?

2 participants