Closed brt-v closed 10 months ago
Hi @brt-v,
Thank you for reporting this issue
We will investigate this problem, but as I remember our tidy does not work on powershell 5.1 without using prefix path
Kind regard, Marina
Thanks for looking into this @mariru27! My PS version is 5.1 (on an up-to-date Win 10 Enterprise), and after the change clang-tidy works perfectly fine. Perhaps it might have been an issue with PS 5.0?
edit: Maybe change the whole thing to this, and be done with it?
[string] $pathToCheck = $aSolutionsPath
Try
{
$slns = Get-ChildItem -recurse -LiteralPath $pathToCheck -Filter "*$kExtensionSolution"
}
Catch
{
# Try fall back for PowerShell <= 5
$pathToCheck = "\\?\$aSolutionsPath"
$slns = Get-ChildItem -recurse -LiteralPath $pathToCheck -Filter "*$kExtensionSolution"
}
Thank you @brt-v, this is a good idea I will make the changes and let you know when a release is available
Kind regards, Marina
Hi @brt-v, a fix for this issue is available
You can update manually our scripts, just make sure you have a good connection to internet
Go to -> Settings -> Compiler -> PowerShell scripts
Kind regards, Marina
Hi @mariru27, That's great, thanks! I've done the update and can confirm that it works that clang-tidy now works for me.
Thanks again for the quick action!
Bart
When I run clang tidy from VS2017 I get:
This is with 2023.8.0, but I've also seen it with older versions.
Things go wrong for me in
function Load-Solutions()
: https://github.com/Caphyon/clang-power-tools/blob/master/ClangPowerTools/ClangPowerTools/Tooling/v1/clang-build.ps1#L534The bit:
prefixes the path with
\\?\
and that causes the error on Get-ChildItem. My$kPsMajorVersion
is 5, so if I change it toit works again. I'm happy to create a PR, however I'm not sure if this breaks tidy for anyone else.