-
-
Save bielawb/34872d13b3d2f5cafe34621e52f29f53 to your computer and use it in GitHub Desktop.
Szukamy komentarzy, które zawierają pomoc z błędami
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$keywords = @( | |
'Synopsis' | |
'Description' | |
'Example' | |
'Inputs' | |
'Outputs' | |
'Notes' | |
'Link' | |
'Component' | |
'Role' | |
'Functionality' | |
) | |
foreach ($suspect in $first, $last) { | |
if ($suspect.Kind -eq 'Comment') { | |
@([regex]::Matches($suspect.Text, '(?m)^\s*\.(.*)$')).Where{ | |
$_.Groups[1].Value.Trim() -notin $keywords -and | |
$_.Groups[1].Value -notmatch 'Parameter \w+' | |
}.ForEach{ | |
'Nieprawidłowa składnia w pomocy: .{0}' -f $_.Groups[1].Value | |
} | |
} else { | |
Write-Verbose -Message "Odnaleziony element nie jest komentarzem: $suspect" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment