PowerShell / PowerShell/PSScriptAnalyzer

Diagnostics.CodeAnalysis.SuppressMessageAttribute should take an array of category names

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

@kapilmb đang làm issue này rồi.

Từ ngày 7/3/2016.

Issue - Enhancement
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ả

The attribute needs to take an array of categories. I shouldn't have to add a new instance of the attribute for each category I want to suppress.

Having to write a separate line for every rule I need to suppress is extremely frustrating and verbose. Take for example this 2 line internal function:

function New-PSCredential {
   [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword")] # It's encoded, leave me alone
   [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPasswordParams")] # That's the whole point of this function
   [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSProvideCommentHelp")] # No point for a constructor function with parameters this simple
   [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSProvideDefaultParameterValue")] # No point for internal functions
   [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly")] # No point for internal functions
   param([string]$UserName, [string]$EncodedPassword)
   New-Object PSCredential $UserName, (ConvertTo-SecureString $EncodedPassword)
}

Seriously?

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.

Đánh giá

Issue này chưa được đánh giá.

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.