diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0cb0e92e5..9ff4f88d4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,7 @@ +## 17.3.0 + +* Better test project detection [#800](https://github.com/fsprojects/FSharp.Formatting/issues/800) + ## 17.2.3 * Fix external docs link [#794](https://github.com/fsprojects/FSharp.Formatting/issues/794) diff --git a/src/fsdocs-tool/ProjectCracker.fs b/src/fsdocs-tool/ProjectCracker.fs index 7436ee495..90bed8fb7 100644 --- a/src/fsdocs-tool/ProjectCracker.fs +++ b/src/fsdocs-tool/ProjectCracker.fs @@ -425,12 +425,16 @@ module Crack = //printfn "projects = %A" projectFiles let projectFiles = projectFiles - |> List.choose (fun s -> - if s.Contains(".Tests") || s.Contains("test") then - printfn " skipping project '%s' because it looks like a test project" (Path.GetFileName s) - None - else - Some s) + |> List.filter (fun s -> + let isFSharpFormattingTestProject = + s.Contains $"FSharp.ApiDocs.Tests{Path.DirectorySeparatorChar}files" + || s.EndsWith "FSharp.Formatting.TestHelpers.fsproj" + + if isFSharpFormattingTestProject then + printfn + $" skipping project '%s{Path.GetFileName s}' because the project is part of the FSharp.Formatting test suite." + + not isFSharpFormattingTestProject) //printfn "filtered projects = %A" projectFiles if projectFiles.Length = 0 && (ignoreProjects |> not) then