PowerShell / PowerShell/PSScriptAnalyzer
Revise semantics of compatibility rule profile inclusion
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 2.2k
- 分支
- 415
- 平均合併
- 13 小時 1 分鐘
- 30 天內合併 PR
- 2
描述
UseCompatibleCommands and UseCompatibleTypes create a "union" profile for comparison of target profiles to a base standard. This allows us to use simple heuristic to determine whether a PowerShell AST represents something that is platform-specific (we see if the command or type is available in any platform, and if not ignore it as user-defined).
The problem here is that to create good warnings we have to have a good baseline union profile. Meaning we need to be judicious about how we make the profile. But since we could get it wrong, I created an informal mechanism for including things into the union profile. We use all the profiles in the "profile directory" and nothing else:
This means that:
- Including only one target, you still get good warnings, because it's compared against all the other profiles we ship by default
- Using a target not in the profile directory, that won't be included in the union comparison
- You can configure a different profile directory to get rid of comparisons to PowerShells you don't care about
This works but it's a bit subtle. I think we should move to:
- All targets are in the union by default
- Targets in the profile directory are in the union by default
- Targets can be excluded from the union in a configuration setting, by name or path
- The profile directory automatic union inclusion can be turned off by default
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 CompatibilityProfileLoader.cs 開始,尤其是 issue 中連結的設定檔目錄載入邏輯,並追蹤 UseCompatibleCommands 和 UseCompatibleTypes 如何建構聯合設定檔。定義對具名目標或以路徑為基礎的目標,以及停用自動包含設定檔目錄的設定與排除行為。完成條件是預設包含所有目標,同時遵循已設定的排除項目和退出設定。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp, powershell
- 領域
- devtools, tooling
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100