From 0502ae2ea680eae076b66207461d4dbc464d63a1 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 08:36:23 +0900 Subject: [PATCH 1/8] Ignore FsUnit.xUnit dependency updates in dependabot configuration. --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ac471923..c15805d6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -60,6 +60,12 @@ updates: - "version-update:semver-major" - "version-update:semver-minor" - "version-update:semver-patch" + # NOTE: FsUnit.xUnit 7.x depends on xUnit 3.x, however, xUnit 3.x is not yet compatible with FsCheck. + - dependency-name: "FsUnit.xUnit" + update-types: + - "version-update:semver-major" + - "version-update:semver-minor" + - "version-update:semver-patch" - dependency-name: "PowerShellStandard.Library" update-types: - "version-update:semver-major" From f37ef23ff56106874a8ec20075aad166e8922597 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 08:37:26 +0900 Subject: [PATCH 2/8] Bump fantomas to 7.0.1. --- .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 3954471b..97b91464 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,7 +10,7 @@ "rollForward": false }, "fantomas": { - "version": "7.0.0", + "version": "7.0.1", "commands": [ "fantomas" ], From de5b82ceb223201b771625e11ae9b31e591b6210 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 10:29:15 +0900 Subject: [PATCH 3/8] Suppress nullness warning in `Query module for unreachable pass. --- src/pocof/Query.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pocof/Query.fs b/src/pocof/Query.fs index 9a7906ff..21774c8e 100644 --- a/src/pocof/Query.fs +++ b/src/pocof/Query.fs @@ -1,3 +1,5 @@ +// NOTE: to avoid nullness warning from LeafExpressionConverter.EvaluateQuotation in unreachable pass. +#nowarn 3264 namespace Pocof open FSharp.Linq.RuntimeHelpers From 1e76e4e0b20aae51df9f5ee8a75f8a211b6c1dd8 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 10:29:58 +0900 Subject: [PATCH 4/8] Improve null handling for mock. --- src/pocof.Test/Library.fs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pocof.Test/Library.fs b/src/pocof.Test/Library.fs index e9a23c7b..a60d0a43 100644 --- a/src/pocof.Test/Library.fs +++ b/src/pocof.Test/Library.fs @@ -74,8 +74,10 @@ module Mock = let mutable errors: ErrorRecord list = List.empty let mutable warnings: string list = List.empty - let write obj = - output <- (nullArgCheck "obj" (obj.ToString())) :: output + let write (obj: obj | null) = + match obj with + | null -> failwith "null" + | obj -> output <- (nullArgCheck "obj" (obj.ToString())) :: output member __.Output = output member __.Errors = errors From 4f1c5431f2f4a9302d5f51a9392001294b7b5d33 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 10:45:50 +0900 Subject: [PATCH 5/8] Restrict `generateDictOfEnum` to Enum types. --- src/pocof/Data.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocof/Data.fs b/src/pocof/Data.fs index 1290cb80..f8f8f4d0 100644 --- a/src/pocof/Data.fs +++ b/src/pocof/Data.fs @@ -155,7 +155,7 @@ module Data = | Entry.Dict dct -> dct | Entry.Obj o -> o) - let generateDictOfEnum<'ENUM> () = + let generateDictOfEnum<'ENUM when 'ENUM :> Enum> () = let dict = Generic.Dictionary(StringComparer.OrdinalIgnoreCase) Enum.GetValues typeof<'ENUM> :?> 'ENUM array From 329bd77fb6698ada551753e6c37995b5fe3afd06 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 11:01:47 +0900 Subject: [PATCH 6/8] Increase verbosity of fantomas check in Lint task. --- psakefile.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psakefile.ps1 b/psakefile.ps1 index 223c9975..e95483bc 100644 --- a/psakefile.ps1 +++ b/psakefile.ps1 @@ -53,7 +53,7 @@ Task Lint { # if (-not $?) { # throw 'dotnet fsharplint failed.' # } - dotnet fantomas ./src --check + dotnet fantomas ./src --check --verbosity detailed if (-not $?) { throw 'dotnet fantomas failed.' } From e9bc4fffaca091a3376f43630f5ddf400b719159 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 18:56:16 +0900 Subject: [PATCH 7/8] Update SDK version to 9.0.103 and pin it to prevent `dotnet tool restore` failure on MacOS due to `NU3018`, `NU3037` and `NU3028`. --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 0959f555..562e3de8 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "rollForward": "latestMinor", - "version": "9.0.101" + "rollForward": "disable", + "version": "9.0.103" } } \ No newline at end of file From d4ff96628ce470a52e74b29fdd0b67f44161e6e0 Mon Sep 17 00:00:00 2001 From: krymtkts Date: Sat, 1 Mar 2025 22:46:12 +0900 Subject: [PATCH 8/8] Add a note about pining .NET SDK version. --- global.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/global.json b/global.json index 562e3de8..ca95d254 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,7 @@ { + // TODO: pin sdk version to 9.0.103 to prevent `dotnet tool restore` failure on MacOS due to `NU3018`, `NU3037` and `NU3028`. "sdk": { "rollForward": "disable", "version": "9.0.103" } -} \ No newline at end of file +}