mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C#: Change string.Format calls to interpolated strings
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Semmle.Autobuild.CSharp
|
||||
|
||||
if (notDotNetProject is not null)
|
||||
{
|
||||
builder.Logger.Log(Severity.Info, "Not using .NET Core because of incompatible project {0}", notDotNetProject);
|
||||
builder.Logger.LogInfo($"Not using .NET Core because of incompatible project {notDotNetProject}");
|
||||
return BuildScript.Failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ namespace Semmle.Autobuild.CSharp
|
||||
}
|
||||
catch (InvalidEnvironmentException ex)
|
||||
{
|
||||
Console.WriteLine("The environment is invalid: {0}", ex.Message);
|
||||
Console.WriteLine($"The environment is invalid: {ex.Message}");
|
||||
}
|
||||
}
|
||||
catch (ArgumentOutOfRangeException ex)
|
||||
{
|
||||
Console.WriteLine("The value \"{0}\" for parameter \"{1}\" is invalid", ex.ActualValue, ex.ParamName);
|
||||
Console.WriteLine($"The value \"{ex.ActualValue}\" for parameter \"{ex.ParamName}\" is invalid");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ namespace Semmle.Autobuild.Cpp
|
||||
}
|
||||
catch (InvalidEnvironmentException ex)
|
||||
{
|
||||
Console.WriteLine("The environment is invalid: {0}", ex.Message);
|
||||
Console.WriteLine($"The environment is invalid: {ex.Message}");
|
||||
}
|
||||
}
|
||||
catch (ArgumentOutOfRangeException ex)
|
||||
{
|
||||
Console.WriteLine("The value \"{0}\" for parameter \"{1}\" is invalid", ex.ActualValue, ex.ParamName);
|
||||
Console.WriteLine($"The value \"{ex.ActualValue}\" for parameter \"{ex.ParamName}\" is invalid");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -128,9 +128,9 @@ namespace Semmle.Autobuild.Shared
|
||||
|
||||
command.Argument("/t:" + target);
|
||||
if (platform is not null)
|
||||
command.Argument(string.Format("/p:Platform=\"{0}\"", platform));
|
||||
command.Argument($"/p:Platform=\"{platform}\"");
|
||||
if (configuration is not null)
|
||||
command.Argument(string.Format("/p:Configuration=\"{0}\"", configuration));
|
||||
command.Argument($"/p:Configuration=\"{configuration}\"");
|
||||
|
||||
// append the build script which invokes msbuild to the overall build script `ret`;
|
||||
// we insert a check that building the current project or solution was successful:
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Semmle.Autobuild.Shared
|
||||
catch // lgtm[cs/catch-of-all-exceptions]
|
||||
// Generic catch clause - Version constructor throws about 5 different exceptions.
|
||||
{
|
||||
builder.Logger.Log(Severity.Warning, "Project {0} has invalid tools version {1}", path, toolsVersion);
|
||||
builder.Logger.LogWarning($"Project {path} has invalid tools version {toolsVersion}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user