Open elviiix opened 5 years ago
Do you need pull request with fix or do you prefer to fix it yourself/other way?
The cpt.config
file is overriding the script parameter values by design. We introduced this mechanism a few releases ago as a way of enabling teams to share and reuse Clang Power Tools settings easily, using source version control.
The Clang Power Tools user interface in the Visual Studio extension is not yet aware of this configuration file and leads to the behavior you are experiencing. We will address this in a future update.
Regards, Gabriel.
It's ok, that cpt.config overrides script parameters. The problem is that it also overrides type of call from outside of script, not only from extension (compile/tidy/tidy-fix). You call compile (from VS or from command line) and get tidy-fix instead of it, and that's pretty nasty.
You set $aTidyFlags/$aTidyFixFlags from cpt and later set WorkloadType based on loaded from cpt values
Need for example to store somewhere values after params and use that stores values for setting workloadType
.. , [alias("vs-sku")] .. [Parameter(Mandatory=$false, HelpMessage="Edition of Visual Studio toolset to use for loading project")] .. [string] $aVisualStudioSku .. )
if (![string]::IsNullOrEmpty($aTidyFlagsOnStart)) { $workloadType = [WorkloadType]::Tidy }
if (![string]::IsNullOrEmpty($aTidyFixFlagsOnStart)) { $workloadType = [WorkloadType]::TidyFix }