Skip to content

Commit 3975af0

Browse files
committed
adding new option for default codescanning config
1 parent 1276f89 commit 3975af0

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/CodeQLToolkit.Shared/CodeQL/CodeQLInstallation.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ public class CodeQLInstallation
1616
{
1717
public string CLIVersion { get; set; }
1818
public string StandardLibraryVersion { get; set; }
19+
20+
public string CodeQLConfiguration { get; set; }
21+
1922
public string CLIBundle { get; set; }
2023
public string StandardLibraryIdent { get; set; }
2124
public bool EnableCustomCodeQLBundles { get; set; }
@@ -45,7 +48,8 @@ public static CodeQLInstallation LoadFromConfig(QLTConfig c)
4548
StandardLibraryIdent = config.CodeQLStandardLibraryIdent,
4649
StandardLibraryVersion = config.CodeQLStandardLibrary,
4750
CustomizationPacks = config.CustomizationPacks,
48-
Base = config.Base
51+
Base = config.Base,
52+
CodeQLConfiguration = config.CodeQLConfiguration
4953
};
5054

5155

@@ -292,7 +296,17 @@ private void CustomBundleInstall()
292296
if (QuickBundle)
293297
{
294298
Log<CodeQLInstallation>.G().LogInformation($"Note: Quick Bundles enabled and pre-compilation will be disabled...");
295-
bundleArgs = $"--log DEBUG -nc -b {customBundleSource} -o {CustomBundleOutputDirectory} -w {workingDirectory} {packs}";
299+
bundleArgs = $"-nc {bundleArgs}";
300+
}
301+
302+
if(CodeQLConfiguration!=null && CodeQLConfiguration.Length > 0)
303+
{
304+
Log<CodeQLInstallation>.G().LogInformation($"Note: Attempting to include default code scanning configuration ...");
305+
306+
if (File.Exists(Path.Combine(Base, CodeQLConfiguration)))
307+
{
308+
bundleArgs = $"-c \"{Path.Combine(Base, CodeQLConfiguration)}\" {bundleArgs}";
309+
}
296310
}
297311

298312
Log<CodeQLInstallation>.G().LogInformation($"Executing Bundle Tool with Working Directory: `{workingDirectory}`");

src/CodeQLToolkit.Shared/Utils/QLTConfig.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public class QLTConfig
1919
public string CodeQLStandardLibrary { get; set; }
2020
public string CodeQLCLIBundle { get; set; }
2121

22+
public string CodeQLConfiguration { get; set; }
23+
2224
public QLTCustomizationPack[] CustomizationPacks { get; set; }
2325

2426
public string CodeQLStandardLibraryIdent {
@@ -31,6 +33,8 @@ public string CodeQLStandardLibraryIdent {
3133
}
3234
}
3335

36+
[JsonIgnore]
37+
public string CodeQLConfigurationPath { get { return Path.Combine(Base, CodeQLConfiguration); } }
3438

3539
[JsonIgnore]
3640
public string Base { get; set; }

0 commit comments

Comments
 (0)