PowerShell / PowerShell/PSScriptAnalyzer
Rule for unused rule suppressions
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ả
Currently there are quiet some reason to suppress a certain rule as e.g.:
- Not be able to (easily) work around an issue
- False positives
There are also a few reasons a rule suppression might get obsolete, e.g.:
- The script issue gets resolved
e.g. all theWrite-Hostcmdlet are been replaced which a different cmdlet - The script issue doesn't anymore apply
e.g. aPSReviewUnusedParameterparameter get completely depreciated or a variable gets (also) used in scope - PSScriptAnalyzer update
e.g. a false positive might get fixed in a newer version of PSScriptAnalyzer
In all the situations I would like to be warned that there is a Diagnostics.CodeAnalysis.SuppressMessageAttribute that is no longer required.
This will avoid a scenario were:
- Someone resolves an analyzer issue (e.g.
PSAvoidUsingWriteHost) in a particular script but forgets to remove theSuppressMessageAttributefrom the annotations - Someone else updates the same script but unseen reintroduces the analyzer issue (e.g.
Write-Host) again.
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
Không có tệp, bài kiểm thử hoặc điểm vào nào được nêu. Hãy bắt đầu bằng cách xác định Diagnostics.CodeAnalysis.SuppressMessageAttribute và các chẩn đoán của analyzer được xử lý như thế nào, sau đó xác định cách phát hiện và báo cáo các suppression đã lỗi thời cho các kịch bản được liệt kê.
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
- 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
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100