PowerShell / PowerShell/PSScriptAnalyzer
Allow modules to provide rules
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 2.2k
- Fork
- 414
- Merge trung bình
- 13 giờ 1 phút
- Pull request đã merge (30 ngày)
- 2
Mô tả
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
usingModulesto 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng việc xem xét hành vi đã được ghi lại của CustomRulePath và MEF, sau đó kiểm tra ValidModPaths và GetValidCustomRulePaths() để hiểu cách phát hiện quy tắc tùy chỉnh hiện tại. Làm rõ cách tiếp cận dự kiến cho việc phát hiện hoặc cấu hình module và xác định cách các quy tắc module hiện có được nhận diện là các triển khai của DiagnosticRecord.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- powershell
- Lĩnh vực
- tooling
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100