diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ebb1d6..9b60768 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,10 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## [Unreleased]
+## [0.26.1] - 2024-08-05
### Fixed
* [Reset the console foreground colour after printing results](https://github.com/ionide/FSharp.Analyzers.SDK/pull/216) (thanks @Numpsy!)
+* [Only Analyze projects passed in via CLI](https://github.com/ionide/FSharp.Analyzers.SDK/pull/217) (thanks @TheAngryByrd)
## [0.26.0] - 2024-05-15
diff --git a/src/FSharp.Analyzers.Cli/Program.fs b/src/FSharp.Analyzers.Cli/Program.fs
index 6531027..8b79100 100644
--- a/src/FSharp.Analyzers.Cli/Program.fs
+++ b/src/FSharp.Analyzers.Cli/Program.fs
@@ -119,6 +119,8 @@ let rec mkKn (ty: Type) =
let mutable logger: ILogger = Abstractions.NullLogger.Instance
+/// Runs MSBuild to create FSharpProjectOptions based on the projPaths.
+/// Returns only the FSharpProjectOptions based on the projPaths and not any referenced projects.
let loadProjects toolsPath properties (projPaths: string list) =
async {
let projPaths =
@@ -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