csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Look into ignored files in csharpier-repos

Open belav opened this issue 4 years ago • 3 comments

The list of files that won't compile or have too deep of recursion in csharpier-repos was ignored. At some point we should review these to see if there are any legit problems in them.

belav avatar Apr 19 '21 22:04 belav

Can this be refactored to not be recursive?

jrobertson-insite avatar Apr 24 '21 16:04 jrobertson-insite

Theoretically. But I haven't been able to wrap my head around how. See https://github.com/belav/csharpier/issues/2 The only failures because of deep recursion have come from files specifically designed to cause recursive code to fail. It doesn't seem worth it to rewrite everything just to get some test files to format.

belav avatar Apr 25 '21 15:04 belav

Easy way to get links to files after saving the output to C:\Users\bela\Documents\errors.txt

$compileErrors = @()
$recursionError = @()
$fileEncoding = @()

foreach ($line in Get-Content "C:\Users\bela\Documents\errors.txt") {
    $line = $line.Replace("Error ", "").Replace("Warning", "")
    if ($line.EndsWith(" - Unable to detect file encoding. Defaulting to System.Text.UTF8Encoding+UTF8EncodingSealed.")) {
        $fileEncoding += $line.Substring(0, $line.IndexOf(" "))
    }
    elseif ($line.EndsWith(" - We can't handle this deep of recursion yet.")) {
        $recursionError += $line.Substring(0, $line.IndexOf(" "))
    }
    elseif ($line.EndsWith(" - Failed to compile so was not formatted.")) {
        $compileErrors += $line.Substring(0, $line.IndexOf(" "))
    }
    else {
        Write-Host $line
    }
}

Write-Output "Compilation Errors"
foreach($line in $compileErrors | Sort-Object) {
    Write-Output $("https://github.com/belav/csharpier-repos/tree/main/" + $line)
}

belav avatar Jan 02 '22 19:01 belav