PowerShell / PowerShell/PSScriptAnalyzer

Allow modules to provide rules

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

還沒有人認領這個 Issue。

Up for Grabs
主要語言
C#
星號
2.2k
分支
414
平均合併
13 小時 1 分鐘
30 天內合併 PR
2

描述

Summary of the new feature

as a user/developer I would like to have rules be defined as a part of a module.

As it stands now, the only possibility i can see right now to import "custom" rules is via CustomRulePath, however documentation and testing leads me to believe this only supports a known static or relative path.

Proposed technical implementation details (optional)

As a part of your documentation you talk about MEF, but this is possibly only for CustomRulePath? I can see as part of instance that you have ValidModPaths, but it seemes to only have data appended by methods in reference to GetValidCustomRulePaths()?

  • checking all commands in psmodulepath that outputs Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord?
    • Alternativly you could have the module require to have psdata.ExternalModuleDependencies defined to scriptanalyzer?
  • alternativly you can add usingModules to settings so you dont need to re-check all modules in current runspace, but just the ones defined by the user

I want Scriptanalyzer to also check available rules from modules.

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

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

首先查看已記錄的 CustomRulePath 和 MEF 行為,然後檢查 ValidModPaths 和 GetValidCustomRulePaths(),以了解目前的自訂規則探索機制。釐清預期的模組探索或設定方式,並定義應如何將可用的模組規則識別為 DiagnosticRecord 實作。

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

評估

技術堆疊
powershell
領域
tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

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

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