Ability to bind concerned PowerShell version to a rule

Đang mở
#2,050 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
csharp, powershell
Lĩnh vực
devtools

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.

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.x statement.
    E.g.:
    • adding #Requires -Version 2.0 would suppress the AvoidUsingWMICmdlet rule
    • adding #Requires -Version 7.0 would allow the use of `e (suppress the proposed UseCompatibleStrings rule)
  • A general UseRequiresStatement rule when a rule with a minimal version applies and the #Requires -Version x.x is not set (or set incorrectly)
    E.g. if any of the rules applies, it generate a warning that the #Requires -Version x.x statement should be set.
Ngôn ngữ chính
C#
Star
2.2k
Fork
415
Merge trung bình
13 giờ 1 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/PSScriptAnalyzer

Tất cả issue của PowerShell/PSScriptAnalyzer

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.