Skip to content

Commit

Permalink
Merge pull request #217 from ionide/214-analyze-only-passed-in-projects
Browse files Browse the repository at this point in the history
Only Analyze projects passed in via CLI
  • Loading branch information
nojaf authored Aug 5, 2024
2 parents 6dd3cd1 + 51184b6 commit 862005d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
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 862005d

Please sign in to comment.