Skip to content

Commit

Permalink
Simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Feb 20, 2024
1 parent 0674feb commit 8a5ded1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/Buildalyzer/Environment/DotNetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ public sealed class DotNetInfo
/// <summary>Parses the input.</summary>
[Pure]
public static DotNetInfo Parse(string? s)
=> DotNetInfoParser.Parse(s?.Split([System.Environment.NewLine], StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) ?? []);
=> Parse(s?.Split([System.Environment.NewLine], StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) ?? []);

/// <summary>Parses the input.</summary>
[Pure]
public static DotNetInfo Parse(IEnumerable<string>? lines)
=> DotNetInfoParser.Parse(lines ?? []);
}
4 changes: 2 additions & 2 deletions src/Buildalyzer/Environment/DotnetPathResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public DotnetPathResolver(ILoggerFactory loggerFactory)
// Don't cache the result because it might change project to project due to global.json
public string ResolvePath(string projectPath, string dotnetExePath)
{
dotnetExePath = dotnetExePath ?? "dotnet";
dotnetExePath ??= "dotnet";
List<string> output = GetInfo(projectPath, dotnetExePath);

var info = DotNetInfoParser.Parse(output);
var info = DotNetInfo.Parse(output);

Check warning on line 25 in src/Buildalyzer/Environment/DotnetPathResolver.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

([deprecated] Use RCS1264 instead) Use explicit type instead of 'var' (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1012)

Check warning on line 25 in src/Buildalyzer/Environment/DotnetPathResolver.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

([deprecated] Use RCS1264 instead) Use explicit type instead of 'var' (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1012)

Check warning on line 25 in src/Buildalyzer/Environment/DotnetPathResolver.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

([deprecated] Use RCS1264 instead) Use explicit type instead of 'var' (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1012)
var basePath = info.BasePath ?? info.Runtimes.Values.FirstOrDefault();

Check warning on line 26 in src/Buildalyzer/Environment/DotnetPathResolver.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

([deprecated] Use RCS1264 instead) Use explicit type instead of 'var' (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1008)

Check warning on line 26 in src/Buildalyzer/Environment/DotnetPathResolver.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

([deprecated] Use RCS1264 instead) Use explicit type instead of 'var' (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1008)

Check warning on line 26 in src/Buildalyzer/Environment/DotnetPathResolver.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

([deprecated] Use RCS1264 instead) Use explicit type instead of 'var' (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1008)

if (basePath is null)
Expand Down

0 comments on commit 8a5ded1

Please sign in to comment.