Commit 3dcca81
Add documentation for skipping individual PSModule framework tests (#252)
The Test-PSModule framework runs style and standards tests against
source code (e.g., enforcing one function per file, requiring
CmdletBinding attributes). Users needed guidance on skipping specific
tests per-file when framework rules don't apply.
## Changes
- **New documentation section** "Skipping Individual Framework Tests"
added to README
- Syntax: `#SkipTest:<TestID>:<Reason>` comment at file top
- Complete reference table of 10 SourceCode test IDs with descriptions
- Module test overview (import/manifest validation)
- Code example demonstrating skip usage
- Best practices and configuration cross-references
## Available Test IDs
| Test ID | What It Enforces |
|---------|------------------|
| `NumberOfProcessors` | Use `[System.Environment]::ProcessorCount` not
`$env:NUMBER_OF_PROCESSORS` |
| `Verbose` | Don't pass `-Verbose` to commands (overrides user
preference) |
| `OutNull` | Use `$null = ...` not `\| Out-Null` |
| `FunctionCount` | One function per file |
| `FunctionName` | Filename matches function name |
| `CmdletBinding` | All functions have `[CmdletBinding()]` |
| `ParamBlock` | All functions have `param()` block |
| `FunctionTest` | Public functions have tests |
## Example
```powershell
#SkipTest:FunctionCount:Contains helper functions for main function
function Get-ComplexData {
[CmdletBinding()]
param([string]$Path)
$data = Get-RawData -Path $Path
return Format-ComplexData -Data $data
}
function Get-RawData { ... }
function Format-ComplexData { ... }
```
Based on analysis of [Test-PSModule framework
tests](https://github.com/PSModule/Test-PSModule/tree/main/scripts/tests).
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>🩹 [Patch]: Add doc for how to skip framework (PSModule)
tests</issue_title>
> <issue_description>### Describe the change
>
> Based on the code in PSModule/Test-PSModule, we need to recreate
guidance in the readme on Process-PSModule for how users can skip
individual tests from the framework, i.e. number of functions to have in
a file.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes #251
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>1 parent 88570b1 commit 3dcca81
1 file changed
+104
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
448 | 552 | | |
449 | 553 | | |
450 | 554 | | |
| |||
0 commit comments