PowerShell / PowerShell/PSScriptAnalyzer
New Rule Suggestion: PSAvoidShorteningParameterNames
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ả
As long as we're trying to get people to stop using aliases and positional parameters and shortened command names, we should fix the parameters too.
Summary of the new feature
A new rule that complains when you write Get-Content -Pa file.txt -ov contents and offers suggestions with the full proper parameter name of each parameter: Get-Content -Path file.txt -OutVariable contents
It should complain about shortened parameters and parameter aliases, when you're passing them directly -- but shouldn't worry about splatting or pipeline properties, etc.
Bonus points if you make it a ConfigurableRule with a setting to ignore parameter names that match aliases (as opposed to just being shortened forms of parameters or parameter aliases).
Double bonus points if you make AvoidPositionalParameters also a ConfigurableRule so people can choose to fail even if only one positional parameter is passed.
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 hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách tìm rule AvoidPositionalParameters hiện có và pattern ConfigurableRule trong PSScriptAnalyzer, sau đó theo dõi cách các rule kiểm tra tham số lệnh. Công việc được xem là hoàn tất khi rule mới xử lý các tên rút gọn và alias, đồng thời loại trừ splatting và các thuộc tính pipeline; cấu hình tùy chọn và các thay đổi đối với AvoidPositionalParameters được hỗ trợ riêng nếu được triển khai.
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
- cli, 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
- 25/100