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 摘要。