Skip to content

Commit

Permalink
Updating SDKs including fantomas
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Apr 10, 2024
1 parent e58cc3a commit e073204
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.2.2",
"version": "5.2.4",
"commands": [
"reportgenerator"
]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.202'
dotnet-version: '8.0.204'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.202'
dotnet-version: '8.0.204'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down
7 changes: 4 additions & 3 deletions AltCover.Engine/Json.fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,10 @@ module internal Json =
))

let tracked =
System.Collections.Generic.Dictionary<string, int *
NativeJson.Times *
NativeJson.Times>()
System.Collections.Generic.Dictionary<
string,
int * NativeJson.Times * NativeJson.Times
>()

x.Descendants(XName.Get "TrackedMethod")
|> Seq.iter (fun x ->
Expand Down
10 changes: 5 additions & 5 deletions AltCover.Engine/Tasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,17 @@ type RetryDelete() =
[<SuppressMessage("Gendarme.Rules.Performance",
"AvoidUnusedParametersRule",
Justification = "Replace the raw exception dump")>]
member internal self.Write0 (o: string->unit) (f:string) (_:string) : unit =
CommandLine.Format.Local("FailedToDelete", f)
|> o
member internal self.Write0 (o: string -> unit) (f: string) (_: string) : unit =
CommandLine.Format.Local("FailedToDelete", f) |> o

member internal self.Write (f:string) (dummy:string) : unit =
member internal self.Write (f: string) (dummy: string) : unit =
self.Write0 (``base``.Log.LogWarning) f dummy

override self.Execute() =
if self.Files.IsNotNull then
self.Files
|> Seq.filter File.Exists
|> Seq.iter (fun f -> (CommandLine.I.doRetry File.Delete (self.Write f) 100 100 0 f))
|> Seq.iter (fun f ->
(CommandLine.I.doRetry File.Delete (self.Write f) 100 100 0 f))

true
6 changes: 2 additions & 4 deletions AltCover.Recorder.Tests/Adapter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ module Adapter =
Definitive = false }

let internal invokeIssue71Wrapper<'T when 'T :> System.Exception>
(
(unique: string),
(called: bool array)
) =
((unique: string), (called: bool array))
=
let constructor =
typeof<'T>
.GetConstructor([| typeof<System.String> |])
Expand Down
24 changes: 14 additions & 10 deletions AltCover.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,17 @@ module AltCoverTests =
let path =
Path.Combine(SolutionDir(), "packages")

let exclude =
Path.Combine(path, "altcover")
let exclude = Path.Combine(path, "altcover")

// Looking for the Mono.Options symbols
let files =
Directory.GetFiles(path, "*.pdb", SearchOption.AllDirectories)

files
|> Seq.filter (_.StartsWith(exclude, StringComparison.OrdinalIgnoreCase) >> not)
|> Seq.filter (
_.StartsWith(exclude, StringComparison.OrdinalIgnoreCase)
>> not
)
|> Seq.filter (fun p -> Path.ChangeExtension(p, ".dll") |> File.Exists)
|> Seq.iter (fun p ->
let dll = Path.ChangeExtension(p, ".dll")
Expand All @@ -326,8 +328,8 @@ module AltCoverTests =

match pdb with
| Some name -> Assert.That(name, Is.EqualTo normalized)
//| _ ->
// raise <| InvalidOperationException((sprintf "%A for %A" dll normalized))
//| _ ->
// raise <| InvalidOperationException((sprintf "%A for %A" dll normalized))
with :? BadImageFormatException ->
())

Expand All @@ -340,15 +342,17 @@ module AltCoverTests =
let path =
Path.Combine(SolutionDir(), "packages")

let exclude =
Path.Combine(path, "altcover")
let exclude = Path.Combine(path, "altcover")

// Looking for the Mono.Options symbols
let files =
Directory.GetFiles(path, "*.pdb", SearchOption.AllDirectories)

files
|> Seq.filter (_.StartsWith(exclude, StringComparison.OrdinalIgnoreCase) >> not)
|> Seq.filter (
_.StartsWith(exclude, StringComparison.OrdinalIgnoreCase)
>> not
)
|> Seq.filter (fun p -> Path.ChangeExtension(p, ".dll") |> File.Exists)
|> Seq.iter (fun p ->
let dll0 = Path.ChangeExtension(p, ".dll")
Expand Down Expand Up @@ -383,8 +387,8 @@ module AltCoverTests =
Assert.That(name, Is.EqualTo normalized)
AltCover.ProgramDatabase.readSymbols def
Assert.That(def.MainModule.HasSymbols, def.MainModule.FileName)
//| _ ->
// raise <| InvalidOperationException((sprintf "%A for %A" dll normalized))
//| _ ->
// raise <| InvalidOperationException((sprintf "%A for %A" dll normalized))
with :? BadImageFormatException ->
())
finally
Expand Down
10 changes: 9 additions & 1 deletion AltCover.Tests/Tests3.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4905,7 +4905,15 @@ module AltCoverTests3 =
.GetMethod("Write0", BindingFlags.NonPublic ||| BindingFlags.Instance)

let mutable written = "written"
write0.Invoke(subject, [| (fun x -> written <- x); "xx"; "yy" |]) |> ignore

write0.Invoke(
subject,
[| (fun x -> written <- x)
"xx"
"yy" |]
)
|> ignore

test <@ written = "Failed to delete file xx" @>

let write =
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="CsvTextFieldParser" Version="1.2.2" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageVersion Include="Expecto" Version="10.1.0" />
<PackageVersion Include="Expecto" Version="10.2.1" />
<PackageVersion Include="Expecto.TestResults" Version="8.13.2" />
<PackageVersion Include="FAKE.Core.Environment" Version="6.0.0" />
<PackageVersion Include="FAKE.Core.Process" Version="6.0.0" />
Expand Down
8 changes: 4 additions & 4 deletions Samples/Sample7/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ module Problematic =

for row = 0 to g.Height do
for col = 0 to g.Width do
Assert.AreEqual(
Assert.That(
System.Drawing.Rectangle(col, row, col, row),
g.Rectangle(col, row)
Is.EqualTo(g.Rectangle(col, row))
)

[<Test>]
Expand All @@ -64,9 +64,9 @@ module Problematic =

for row = 0 to g.Height do
for col = 0 to g.Width do
Assert.AreEqual(
Assert.That(
System.Drawing.Rectangle(col, row, col, row),
g.Rectangle(col, row)
Is.EqualTo(g.Rectangle(col, row))
)
finally
System.Console.WriteLine("Finally")
Expand Down
4 changes: 2 additions & 2 deletions Samples/Sample7/Sample7.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FsUnit" VersionOverride="5.6.0" />
<PackageReference Include="NUnit" VersionOverride="3.14.0" />
<PackageReference Include="FsUnit" />
<PackageReference Include="NUnit" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit3TestAdapter">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.202",
"version": "8.0.204",
"rollForward": "latestMinor"
}
}

0 comments on commit e073204

Please sign in to comment.