PowerShell / PowerShell/PSScriptAnalyzer
PSUseCorrectCasing malfunctioning in DSC configuration
Đang mở
Chưa có ai nhận issue này.
Area - Formatter
- 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ả
PSUseCorrectCasing is erroneously changing Type to type in a DSC configuration.
Steps to reproduce
$settings = @{
IncludeRules = @("PSUseCorrectCasing")
Rules = @{
PSUseCorrectCasing = @{
Enable = $true
}
}
}
Invoke-Formatter -Settings $settings -ScriptDefinition @'
Configuration ApacheServer{
Node localhost{
nxFile vHostDirectory{
DestinationPath = $VhostDir
Type = "Directory"
Ensure = "Present"
Owner = "root"
Mode = "744"
}
}
}
'@
Expected behavior
Configuration ApacheServer{
Node localhost{
nxFile vHostDirectory{
DestinationPath = $VhostDir
Type = "Directory"
Ensure = "Present"
Owner = "root"
Mode = "744"
}
}
}
Actual behavior
Configuration ApacheServer{
Node localhost{
nxFile vHostDirectory{
DestinationPath = $VhostDir
type = "Directory"
Ensure = "Present"
Owner = "root"
Mode = "744"
}
}
}
Environment data
> $PSVersionTable
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.19.0
1.18.3
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 tái hiện vấn đề với Invoke-Formatter, quy tắc PSUseCorrectCasing và cấu hình DSC được nêu trong báo cáo. Theo dõi cách quy tắc xử lý thuộc tính nxFile của DSC và xác minh rằng việc định dạng giữ nguyên Type thay vì đổi thành type.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- powershell
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 45/100