Skip to content

Commit

Permalink
Fix new analyzer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Jul 28, 2023
1 parent 81a6878 commit 99a2229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand

protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
if (!ShowCompilerWarnings && singleLine.IndexOf("warning:", StringComparison.OrdinalIgnoreCase) != -1)
if (!ShowCompilerWarnings && singleLine.Contains("warning:", StringComparison.OrdinalIgnoreCase))
{
Log.LogMessage(MessageImportance.Normal, singleLine);
WarningsDetected = true;
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private void UpdateAppRef(string sdkPath, string version)
private string GetNuGetConfig()
{
string contents = File.ReadAllText(TemplateNuGetConfigPath);
if (contents.IndexOf(s_nugetInsertionTag, StringComparison.InvariantCultureIgnoreCase) < 0)
if (!contents.Contains(s_nugetInsertionTag, StringComparison.InvariantCultureIgnoreCase))
throw new LogAsErrorException($"Could not find {s_nugetInsertionTag} in {TemplateNuGetConfigPath}");

return contents.Replace(s_nugetInsertionTag, $@"<add key=""nuget-local"" value=""{LocalNuGetsPath}"" />");
Expand Down Expand Up @@ -423,7 +423,7 @@ internal sealed record InstallWorkloadRequest(
public string Version => Workload.GetMetadata("Version");
public string TargetPath => Target.GetMetadata("InstallPath");
public string StampPath => Target.GetMetadata("StampPath");
public bool IgnoreErrors => Workload.GetMetadata("IgnoreErrors").ToLowerInvariant() == "true";
public bool IgnoreErrors => Workload.GetMetadata("IgnoreErrors").Equals("true", StringComparison.InvariantCultureIgnoreCase);
public string WorkloadId => Workload.ItemSpec;

public bool Validate(TaskLoggingHelper log)
Expand Down

0 comments on commit 99a2229

Please sign in to comment.