Skip to content

Commit

Permalink
Analyze only projects passed in via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAngryByrd committed Aug 5, 2024
1 parent 6dd3cd1 commit 26b1c13
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/FSharp.Analyzers.Cli/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ let rec mkKn (ty: Type) =

let mutable logger: ILogger = Abstractions.NullLogger.Instance

/// <summary>Runs MSBuild to create FSharpProjectOptions based on the projPaths.</summary>
/// <returns>Returns only the FSharpProjectOptions based on the projPaths and not any referenced projects.</returns>
let loadProjects toolsPath properties (projPaths: string list) =
async {
let projPaths =
Expand All @@ -140,7 +142,12 @@ let loadProjects toolsPath properties (projPaths: string list) =
logger.LogError("Failed to load project '{0}'", failedLoads)
exit 1

return FCS.mapManyOptions projectOptions |> Seq.toList
let loaded =
FCS.mapManyOptions projectOptions
|> Seq.filter (fun p -> projPaths |> List.exists (fun x -> x = p.ProjectFileName)) // We only want to analyze what was passed in
|> Seq.toList

return loaded
}

let runProject
Expand Down

0 comments on commit 26b1c13

Please sign in to comment.