PowerShell / PowerShell/PSScriptAnalyzer
Ability to bind concerned PowerShell version to a rule
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ả
It might be helpful that in the case a rule only applies to a specific (minimum) PowerShell versions as for e.g.:
And new request/issues:
to have the possibility to add that (minimum) PowerShell version (e.g. MininumPowerShellVersion) to that rule.
Meaning e.g. the AvoidUsingWMICmdlet rule might have MininumPowerShellVersion set to 3.0
This would add the possibility for two additional features:
- Suppressing the specific rule by using the
#Requires -Version x.xstatement.
E.g.:- adding
#Requires -Version 2.0would suppress theAvoidUsingWMICmdletrule - adding
#Requires -Version 7.0would allow the use of`e(suppress the proposedUseCompatibleStringsrule)
- adding
- A general
UseRequiresStatementrule when a rule with a minimal version applies and the#Requires -Version x.xis not set (or set incorrectly)
E.g. if any of the rules applies, it generate a warning that the#Requires -Version x.xstatement should be set.
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 cách đọc tài liệu của rule AvoidUsingWMICmdlet và các issue được liên kết UseCompatibleStrings, UseCompatibleSyntax và AvoidNewObjectCmdlet. Sau đó, theo dõi cách các rule được biểu diễn và cách #Requires -Version được xử lý. Được xem là hoàn tất khi hành vi đề xuất cho phiên bản tối thiểu, việc suppression và hành vi của UseRequiresStatement có phạm vi triển khai được xác định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, powershell
- Lĩnh vực
- devtools
- 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