Skip to content

feat(rules): add PowerShell review support - #970

Open
xwil1 wants to merge 2 commits into
alibaba:mainfrom
xwil1:agent/powershell-review-support
Open

feat(rules): add PowerShell review support#970
xwil1 wants to merge 2 commits into
alibaba:mainfrom
xwil1:agent/powershell-review-support

Conversation

@xwil1

@xwil1 xwil1 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add .psm1 and .psd1 to the existing PowerShell .ps1 allowlist support
  • exclude Pester's conventional *.Tests.ps1 test files
  • add and register a PowerShell-specific review rule for scripts, modules, and data/manifest files
  • cover case-insensitive extension matching, exclusion boundaries, and rule resolution

Why

PowerShell scripts currently fall back to the generic review rule, while standard module and manifest formats are not reviewed at all. The dedicated rule focuses on PowerShell-specific correctness and security boundaries, including command construction, non-terminating errors, native process status, pipeline output, credentials, remoting, module exports, and cross-version/platform compatibility.

Validation

  • make license-add
  • make check
  • make test
  • make coverage (91.5% total coverage)
  • ocr review --audience agent ... (0 findings)
  • PowerShell 7.6.5 parsed .ps1, .psm1, and .psd1 fixtures without errors
  • Test-ModuleManifest and module import/export validation passed
  • Pester 6.1.0: 1 test passed, 0 failed
  • PSScriptAnalyzer 1.25.0: 0 findings on valid fixtures and the expected injection finding on an Invoke-Expression fixture
  • ocr rules check matched **/*.{ps1,psm1,psd1} for all three extensions

Closes #969

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s).

…ew-support

# Conflicts:
#	internal/config/allowlist/allowed_ext_test.go
@xwil1
xwil1 marked this pull request as ready for review August 17, 2026 09:47

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Site documentation updates missing, update at pages/src/content/docs/<locale>/review-rules.md.

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.

feat(language): add complete PowerShell review support

2 participants