From d47e5a800177c9dff2613fa81f2890b71ed38f9e Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 9 Nov 2023 10:33:24 +0100 Subject: [PATCH 1/6] Bump fsdocs-tool to 20.0.0-alpha-005 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3491cd0..def5a82 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "fsdocs-tool": { - "version": "20.0.0-alpha-002", + "version": "20.0.0-alpha-005", "commands": [ "fsdocs" ] From c229e88bf56f0f99be167c1deedbb9de2ae35067 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 9 Nov 2023 11:45:29 +0100 Subject: [PATCH 2/6] - don't transform projectpaths to absolute path two times - improve handling of bad --project args --- src/FSharp.Analyzers.Cli/Program.fs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/FSharp.Analyzers.Cli/Program.fs b/src/FSharp.Analyzers.Cli/Program.fs index 86d4b55..3261997 100644 --- a/src/FSharp.Analyzers.Cli/Program.fs +++ b/src/FSharp.Analyzers.Cli/Program.fs @@ -449,20 +449,13 @@ let main argv = exit 1 | [], Some fscArgs -> runFscArgs client fscArgs ignoreFiles severityMapping |> Async.RunSynchronously | projects, None -> - let runProj (proj: string) = - async { - let project = - if Path.IsPathRooted proj then - proj - else - Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, proj)) - - let! results = runProject client toolsPath project ignoreFiles severityMapping - return results - } + for projPath in projects do + if not (File.Exists(projPath)) then + printError $"Invalid `--project` argument. File does not exist: '{projPath}'" + exit 1 projects - |> List.map runProj + |> List.map (fun projPath -> runProject client toolsPath projPath ignoreFiles severityMapping) |> Async.Sequential |> Async.RunSynchronously |> Array.choose id From ba75698d2724b860a8dd788e744014b63502ba54 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 9 Nov 2023 11:48:52 +0100 Subject: [PATCH 3/6] add changelog entry --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 578fb01..d70e4bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +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] + +### Fixed +* [--project value should be tested if path exists](https://github.com/ionide/FSharp.Analyzers.SDK/issues/141) (thanks @dawedawe!) + ## [0.19.0] - 2023-11-08 ### Changed From 2248eccc651f1129f8d6c8eb78d296f8513589df Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 9 Nov 2023 13:33:43 +0100 Subject: [PATCH 4/6] better handling for failed project loading --- src/FSharp.Analyzers.Cli/Program.fs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/FSharp.Analyzers.Cli/Program.fs b/src/FSharp.Analyzers.Cli/Program.fs index 86d4b55..d4b93d7 100644 --- a/src/FSharp.Analyzers.Cli/Program.fs +++ b/src/FSharp.Analyzers.Cli/Program.fs @@ -112,6 +112,11 @@ let loadProject toolsPath projPath = async { let loader = WorkspaceLoader.Create(toolsPath) let parsed = loader.LoadProjects [ projPath ] |> Seq.toList + + if parsed.IsEmpty then + printError $"Failed to load project '{projPath}'" + exit 1 + let fcsPo = FCS.mapToFSharpProjectOptions parsed.Head parsed return fcsPo From 0f3c8958c7635df20fa475257b558e3a83613de6 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 9 Nov 2023 13:35:31 +0100 Subject: [PATCH 5/6] add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 578fb01..addbccc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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] + +### Fixed +* [--project value should be tested if path exists](https://github.com/ionide/FSharp.Analyzers.SDK/issues/141) (thanks @dawedawe!) +* [Provide better DX when project cracking failed](https://github.com/ionide/FSharp.Analyzers.SDK/issues/126) (thanks @dawedawe!) + ## [0.19.0] - 2023-11-08 ### Changed From d376c31360f0e12a40838083d89df0cdc16110de Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 9 Nov 2023 13:48:37 +0100 Subject: [PATCH 6/6] remove changelog entry from other PR --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index addbccc..c12b25d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,6 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Fixed -* [--project value should be tested if path exists](https://github.com/ionide/FSharp.Analyzers.SDK/issues/141) (thanks @dawedawe!) * [Provide better DX when project cracking failed](https://github.com/ionide/FSharp.Analyzers.SDK/issues/126) (thanks @dawedawe!) ## [0.19.0] - 2023-11-08