Skip to content

Commit

Permalink
Merge pull request #13 from Numpsy/fsproj
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson authored Sep 27, 2023
2 parents 5269dc7 + 4bac284 commit 08533b5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Covenant/Analysis/Dotnet/DotnetAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ public override bool ShouldTraverse(DirectoryPath path)
public override bool CanHandle(AnalysisContext context, FilePath path)
{
var isSolution = path.GetExtension()?.Equals(".sln", StringComparison.OrdinalIgnoreCase) ?? false;
var isProject = path.GetExtension()?.Equals(".csproj", StringComparison.OrdinalIgnoreCase) ?? false;
return isSolution || isProject;
var isCsProject = path.GetExtension()?.Equals(".csproj", StringComparison.OrdinalIgnoreCase) ?? false;
var isFsProject = path.GetExtension()?.Equals(".fsproj", StringComparison.OrdinalIgnoreCase) ?? false;
return isSolution || isCsProject || isFsProject;
}

public override void Analyze(AnalysisContext context, FilePath path)
{
path = path.MakeAbsolute(_environment);
var extension = path.GetExtension();
var extension = path.GetExtension() ?? string.Empty;

if (extension?.Equals(".sln", StringComparison.OrdinalIgnoreCase) ?? false)
if (extension.Equals(".sln", StringComparison.OrdinalIgnoreCase))
{
// Analyze solution
var solution = SolutionFile.Parse(path.FullPath);
Expand Down Expand Up @@ -91,7 +92,8 @@ public override void Analyze(AnalysisContext context, FilePath path)
AnalyzeProjectDependencies(context, assetFile);
}
}
else if (extension?.Equals(".csproj", StringComparison.OrdinalIgnoreCase) ?? false)
else if (extension.Equals(".csproj", StringComparison.OrdinalIgnoreCase) ||
extension.Equals(".fsproj", StringComparison.OrdinalIgnoreCase))
{
var assetsFile = ReadAssetFile(context, path);
if (assetsFile != null)
Expand Down

0 comments on commit 08533b5

Please sign in to comment.