mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-20 16:01:39 +02:00
Fix some SonarCloud warnings (#1138)
* r * hdr * sc * StyleCop.Analyzers
This commit is contained in:
9
hdr.ps1
9
hdr.ps1
@@ -7,11 +7,12 @@ function Write-Header ($file) {
|
||||
$content = Get-Content $file -Raw # Using -Raw to read the entire file as a single string
|
||||
$filename = Split-Path -Leaf $file
|
||||
|
||||
# Check if the file content starts with the auto-generated line
|
||||
if ($content.TrimStart().StartsWith("// <auto-generated>")) {
|
||||
Write-Host "Skipping auto-generated file: $filename"
|
||||
if ($content.TrimStart().StartsWith($header.Trim())) {
|
||||
# Write-Host "Skipping existing: $filename"
|
||||
} elseif ($content.TrimStart().StartsWith("// <auto-generated>")) {
|
||||
# Write-Host "Skipping auto-generated file: $filename"
|
||||
} else {
|
||||
# If not an auto-generated file, prepend the header
|
||||
Write-Host "Prepend the header for file: $filename"
|
||||
Set-Content $file $header
|
||||
Add-Content $file $content -NoNewline # Writing back to the file without an extra newline
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user