PowerShell / PowerShell/PSScriptAnalyzer

Add rules for Named/Positional Parameter use on object creation

未關閉
#2,006 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Issue - New Rule Issue-Enhancement
主要語言
C#
星號
2.2k
分支
414
平均合併
13 小時 1 分鐘
30 天內合併 PR
2

描述

*Summary of the new feature
This PR in PowerShell - Add support for named argument with .NET Methods will add additional functionality which would be useful to add some rules around it's use to aid in coding styles, not only to aid in coding style but to reduce errors in use

Examples & levels that I think would be useful include

  • Avoid mixing named & positional parameters on object creation (Information)
  • Use only named parameters for object creation (Information)
  • Use only positional parameters for object creation (Warning) (for backcompat checks

What is the latest version of PSScriptAnalyzer at the point of writing
1.22.0

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先檢視連結的 PowerShell PR,了解具名引數的行為,並釐清 PSScriptAnalyzer 應如何區分物件建立與其他呼叫。定義此規則對混合引數、僅具名引數和僅位置引數的適用範圍及嚴重性,接著新增分析器涵蓋測試,確認每種情況都會產生預期的診斷。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, powershell
領域
tooling
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
32/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。