Skip to content

Commit 862005d

Browse files
authored
Merge pull request #217 from ionide/214-analyze-only-passed-in-projects
Only Analyze projects passed in via CLI
2 parents 6dd3cd1 + 51184b6 commit 862005d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.26.1] - 2024-08-05
99

1010
### Fixed
1111
* [Reset the console foreground colour after printing results](https://github.com/ionide/FSharp.Analyzers.SDK/pull/216) (thanks @Numpsy!)
12+
* [Only Analyze projects passed in via CLI](https://github.com/ionide/FSharp.Analyzers.SDK/pull/217) (thanks @TheAngryByrd)
1213

1314
## [0.26.0] - 2024-05-15
1415

src/FSharp.Analyzers.Cli/Program.fs

+8-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ let rec mkKn (ty: Type) =
119119

120120
let mutable logger: ILogger = Abstractions.NullLogger.Instance
121121

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

143-
return FCS.mapManyOptions projectOptions |> Seq.toList
145+
let loaded =
146+
FCS.mapManyOptions projectOptions
147+
|> Seq.filter (fun p -> projPaths |> List.exists (fun x -> x = p.ProjectFileName)) // We only want to analyze what was passed in
148+
|> Seq.toList
149+
150+
return loaded
144151
}
145152

146153
let runProject

0 commit comments

Comments
 (0)