Skip to content

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

Merged
lizhengfeng101 merged 4 commits into
alibaba:mainfrom
xwil1:agent/powershell-review-support
Oct 19, 2026
Merged

lizhengfeng101 merged 4 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.
  • Register a dedicated PowerShell review rule for scripts, modules, and data/manifest files, with links to Microsoft Learn and Pester documentation.
  • Cover extension matching, rule resolution, and Pester file selection. *.Tests.ps1 files remain reviewable; generic fixture exclusions still apply.
  • Document the mapping in English, Chinese, Japanese, Korean, and Russian.

Why

PowerShell scripts otherwise use the generic review rule, while standard module and manifest formats are not admitted for review. The dedicated rule focuses on command construction, error handling, pipeline output, credentials, remoting, module contracts, and version/platform compatibility.

The rule distinguishes native exit-code handling policies, recognizes PowerShell 7.3+ cleanup and argument-passing behavior, and accounts for PowerShell 7.5 array-addition improvements. It also avoids treating legitimate SecureString conversions or restricted manifest expressions as defects, and clarifies that TestDrive is not a general sandbox.

Validation

  • Rebased onto main at 8eb8334, preserving upstream language mappings and all five documentation tables.
  • make check (license, source language, formatting, module consistency, and vet).
  • make test, including the full race-enabled suite.
  • make coverage: 91.5%, above the 90% threshold.
  • Pages: lint (0 errors, 2 existing warnings), typecheck, all 38 tests, production build, and size check (95.11 kB Brotli / 150 kB limit). Build output was directed to an isolated temporary directory; the two webpack size warnings concern unchanged upstream code.
  • git diff --check.
  • PowerShell 7.6.5: 16 local assertions passed, covering success-stream output, pipeline input, non-terminating versus terminating errors, native-command preferences, cleanup, ShouldProcess/WhatIf, data/manifest loading, module exports, and parsing all three file formats.
  • Windows PowerShell 5.1 was not executed on this macOS host; version-specific guidance links to the relevant official documentation.
  • OCR self-review was attempted with explicit inclusion of Markdown and Go test files. The provider rejected the requests due to insufficient account credit, so no completed model-review result is claimed for this revision.

Closes #969

@github-actions

Copy link
Copy Markdown
Contributor

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

@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.

"**/test/**/*.lhs",
"**/*Spec.lhs",
"**/tests/**/*.nim",
"**/*.Tests.ps1",

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.

Why is this in the default_exclude_patterns.json?

Suggested change
"**/*.Tests.ps1",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sorry,Pester tests normally use *.Tests.ps1, so I added it to match the existing test-file exclusions. But this conflicts with the Pester checks in the PowerShell rule. I'll remove it.

@wu21-web

wu21-web commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@xwil1 Rebase and sync Korean translations.

@xwil1
xwil1 force-pushed the agent/powershell-review-support branch 2 times, most recently from 8a14a8c to a244992 Compare September 2, 2026 05:50
@xwil1

xwil1 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@xwil1 Rebase and sync Korean translations.

ok

@wu21-web

Copy link
Copy Markdown
Contributor

@xwil1 Thanks for your submission! Here are some tasks

  • Rebase main and resolve all merge conflicts.
  • Review the documentation yourself according to official sources.

This looks high quality overall. I am happy to tell that language PRs are being pushed forward.

@xwil1
xwil1 force-pushed the agent/powershell-review-support branch from a244992 to e4bcae3 Compare October 17, 2026 08:19
@xwil1

xwil1 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

@xwil1 Thanks for your submission! Here are some tasks

  • Rebase main and resolve all merge conflicts.
  • Review the documentation yourself according to official sources.

This looks high quality overall. I am happy to tell that language PRs are being pushed forward.

ok

@lizhengfeng101 lizhengfeng101 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.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 46790d9 into alibaba:main Oct 19, 2026
15 checks passed
@lizhengfeng101 lizhengfeng101 mentioned this pull request Oct 19, 2026
14 of 16 tasks
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

3 participants