Skip to content

Commit

Permalink
Merge branch 'develop/issue-197' into release/Habu
Browse files Browse the repository at this point in the history
# Conflicts:
#	Build/targets.fs
  • Loading branch information
SteveGilham committed Jan 4, 2024
2 parents 26e7864 + 654afbb commit 3ba64d6
Show file tree
Hide file tree
Showing 131 changed files with 1,309 additions and 1,137 deletions.
6 changes: 3 additions & 3 deletions .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.1.26",
"version": "5.2.0",
"commands": [
"reportgenerator"
]
Expand All @@ -15,13 +15,13 @@
]
},
"altcode.gendarme-tool": {
"version": "2023.8.26.15512",
"version": "2023.12.27.19054",
"commands": [
"gendarme"
]
},
"dotnet-fsharplint": {
"version": "0.21.3",
"version": "0.23.0",
"commands": [
"dotnet-fsharplint"
]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: Tools
Expand All @@ -42,11 +42,11 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
NUGET_API_TOKEN: ${{ secrets.NUGET_API_TOKEN }}
run: dotnet run --project .\Build\Build.fsproj
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: nupkgs
path: _Packagin*/*.nupkg
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: reports.windows
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: Tools
Expand All @@ -70,7 +70,7 @@ jobs:
run: dotnet run --project ./Build/Setup.fsproj
- name: Build
run: dotnet run --project ./Build/Build.fsproj
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: reports.linux
Expand Down
3 changes: 2 additions & 1 deletion AltCover.Api.Tests/AltCover.Api.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="NUnit" VersionOverride="3.14.0" Condition="'$(TargetFramework)' == 'net472'" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="FSharp.Core">
<ExcludeAssets>contentfiles</ExcludeAssets>
Expand Down
40 changes: 17 additions & 23 deletions AltCover.Api.Tests/FSApiTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ module FSApiTests =
Assembly
.GetExecutingAssembly()
.GetManifestResourceNames()
|> Seq.find (fun n ->
n.EndsWith("OpenCoverForPester.coverlet.xml", StringComparison.Ordinal))
|> Seq.find _.EndsWith("OpenCoverForPester.coverlet.xml", StringComparison.Ordinal)

use stream =
Assembly
Expand All @@ -44,7 +43,7 @@ module FSApiTests =
Assembly
.GetExecutingAssembly()
.GetManifestResourceNames()
|> Seq.find (fun n -> n.EndsWith("OpenCoverStrict.xsd", StringComparison.Ordinal))
|> Seq.find _.EndsWith("OpenCoverStrict.xsd", StringComparison.Ordinal)

use sstream =
Assembly
Expand All @@ -71,8 +70,7 @@ module FSApiTests =
Assembly
.GetExecutingAssembly()
.GetManifestResourceNames()
|> Seq.find (fun n ->
n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal))
|> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)

use stream =
Assembly
Expand Down Expand Up @@ -103,7 +101,7 @@ module FSApiTests =

after.Descendants(XName.Get "SequencePoint")
|> Seq.toList
|> List.iter (fun el -> el.Remove())
|> List.iter _.Remove()

after.Descendants(XName.Get "MethodPoint")
|> Seq.iter (fun el -> setAttribute el "vc" "0")
Expand Down Expand Up @@ -890,7 +888,7 @@ module FSApiTests =
let doc = XDocument.Load(stream)

doc.Descendants()
|> Seq.map (fun n -> n.Attribute(XName.Get "excluded"))
|> Seq.map _.Attribute(XName.Get "excluded")
|> Seq.filter (isNull >> not)
|> Seq.iter (fun a -> a.Value <- "false")

Expand Down Expand Up @@ -944,7 +942,7 @@ module FSApiTests =
let doc = XDocument.Load(stream)

doc.Descendants()
|> Seq.map (fun n -> n.Attribute(XName.Get "excluded"))
|> Seq.map _.Attribute(XName.Get "excluded")
|> Seq.filter (isNull >> not)
|> Seq.iter (fun a -> a.Value <- "false")

Expand Down Expand Up @@ -1150,7 +1148,7 @@ module FSApiTests =
Assembly
.GetExecutingAssembly()
.GetManifestResourceNames()
|> Seq.find (fun n -> n.EndsWith("AltCover.targets", StringComparison.Ordinal))
|> Seq.find _.EndsWith("AltCover.targets", StringComparison.Ordinal)

use stream =
Assembly
Expand All @@ -1161,19 +1159,19 @@ module FSApiTests =

let prepare =
doc.Descendants()
|> Seq.filter (fun d -> d.Name.LocalName = "AltCover.Prepare")
|> Seq.filter _.Name.LocalName.Equals("AltCover.Prepare")
|> Seq.head

let prepareNames =
prepare.Attributes()
|> Seq.map (fun p -> p.Name.LocalName.ToLowerInvariant())
|> Seq.map _.Name.LocalName.ToLowerInvariant()
|> Seq.sort
|> Seq.toList

let prepareFragments =
[ DotNet.I.toPrepareListArgumentList
>> (List.map (fun (_, n, _) -> n))
(fun p -> p.Verbosity)
_.Verbosity
>> DotNet.I.toSharedFromValueArgumentList
>> (List.map (fun (_, n, _, _) -> n))
DotNet.I.toPrepareFromArgArgumentList
Expand All @@ -1191,24 +1189,21 @@ module FSApiTests =

let collect =
doc.Descendants()
|> Seq.filter (fun d -> d.Name.LocalName = "AltCover.Collect")
|> Seq.filter _.Name.LocalName.Equals("AltCover.Collect")
|> Seq.head

let collectNames =
collect.Attributes()
|> Seq.map (fun p -> p.Name.LocalName.ToLowerInvariant())
|> Seq.map _.Name.LocalName.ToLowerInvariant()
|> Seq.sort
|> Seq.toList

let collectFragments =
[ //DotNet.I.toCollectListArgumentList >> (List.map (fun (_,n,_) -> n))
DotNet.I.toCollectFromArgArgumentList
[ DotNet.I.toCollectFromArgArgumentList
>> (List.map (fun (_, n, _) -> n))
(fun c -> c.Verbosity)
_.Verbosity
>> DotNet.I.toSharedFromValueArgumentList
>> (List.map (fun (_, n, _, _) -> n))
//DotNet.I.toCollectArgArgumentList >> (List.map (fun (_,n,_,_) -> n))
]
>> (List.map (fun (_, n, _, _) -> n)) ]
|> List.collect (fun f -> f coll)
|> List.sort

Expand All @@ -1220,7 +1215,7 @@ module FSApiTests =

let optionNames =
typeof<DotNet.CLIOptions>.GetProperties()
|> Seq.map (fun p -> p.Name.ToLowerInvariant())
|> Seq.map _.Name.ToLowerInvariant()
|> Seq.sort
|> Seq.toList

Expand All @@ -1232,8 +1227,7 @@ module FSApiTests =
let opt = DotNet.CLIOptions.Fail true

let optionsFragments =
[ //DotNet.I.toCollectListArgumentList >> (List.map (fun (_,n,_) -> n))
DotNet.I.toCLIOptionsFromArgArgumentList
[ DotNet.I.toCLIOptionsFromArgArgumentList
>> (List.map (fun (_, n, _) -> n))
DotNet.I.toCLIOptionsArgArgumentList
>> (List.map (fun (_, n, _, _) -> n)) ]
Expand Down
1 change: 1 addition & 0 deletions AltCover.Async/AltCover.Async.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<OtherFlags>--keyfile:$(InfrastructureKey)</OtherFlags>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
6 changes: 3 additions & 3 deletions AltCover.Avalonia/AltCover.Avalonia.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Desktop" />
<PackageReference Include="MessageBox.Avalonia" />
<PackageReference Include="Avalonia" VersionOverride="0.10.18" />
<PackageReference Include="Avalonia.Desktop" VersionOverride="0.10.18" />
<PackageReference Include="MessageBox.Avalonia" VersionOverride="2.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
10 changes: 5 additions & 5 deletions AltCover.Avalonia/AltCover.Avalonia11.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" VersionOverride="11.0.5" />
<PackageReference Include="Avalonia.Desktop" VersionOverride="11.0.5" />
<PackageReference Include="Avalonia.Themes.Fluent" VersionOverride="11.0.5" />
<PackageReference Include="Avalonia.Themes.Simple" VersionOverride="11.0.5" />
<PackageReference Include="MessageBox.Avalonia" VersionOverride="3.1.5.1" />
<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Desktop" />
<PackageReference Include="Avalonia.Themes.Fluent" />
<PackageReference Include="Avalonia.Themes.Simple" />
<PackageReference Include="MessageBox.Avalonia" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
9 changes: 5 additions & 4 deletions AltCover.Avalonia/MainWindow.fs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ type MainWindow() as this =
[<SuppressMessage("Gendarme.Rules.Portability",
"NewLineLiteralRule",
Justification = "That is kind of the point...")>]
[<TailCall>]
let rec linesOfString (s: string) (start: int) (lines: TextLine list) =
let rn = s.IndexOf("\r\n", start)

Expand Down Expand Up @@ -422,7 +423,7 @@ type MainWindow() as this =
(n.Column - 1)
+ (lines
|> Seq.take (n.Line - 1)
|> Seq.sumBy (fun l -> l.Length))
|> Seq.sumBy _.Length)

let ec =
if n.LineOnly then
Expand Down Expand Up @@ -894,7 +895,7 @@ type MainWindow() as this =

s |> Async.AwaitTask |> Async.RunSynchronously)
|> Option.ofObj
|> Option.map (fun x -> x.FirstOrDefault() |> Option.ofObj)
|> Option.map (_.FirstOrDefault() >> Option.ofObj)
|> Option.iter openFile.Trigger
}
|> Async.Start)
Expand Down Expand Up @@ -1015,7 +1016,7 @@ type MainWindow() as this =
|> Event.add (fun index ->
let mutable auxModel =
{ Model = List<TreeViewItem>()
Row = null }
Row = nullObject }

let addNode =
fun
Expand Down Expand Up @@ -1069,7 +1070,7 @@ type MainWindow() as this =
this.Title <- "AltCover.Visualizer"

tree.Items.OfType<IDisposable>()
|> Seq.iter (fun x -> x.Dispose())
|> Seq.iter _.Dispose()

let t1 =
#if AVALONIA11
Expand Down
6 changes: 3 additions & 3 deletions AltCover.DotNet/DotNet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ module DotNet =
| Force b -> b
| Summary _
| Fail _ -> false
| Many s -> s |> Seq.exists (fun f -> f.ForceDelete)
| Many s -> s |> Seq.exists _.ForceDelete
| Abstract a -> a.ForceDelete

member self.FailFast =
match self with
| Fail b -> b
| Summary _
| Force _ -> false
| Many s -> s |> Seq.exists (fun f -> f.FailFast)
| Many s -> s |> Seq.exists _.FailFast
| Abstract a -> a.FailFast

member self.ShowSummary =
let select (s: CLIOptions seq) =
s
|> Seq.map (fun f -> f.ShowSummary)
|> Seq.map _.ShowSummary
|> Seq.filter (String.IsNullOrWhiteSpace >> not)
|> Seq.tryHead

Expand Down
1 change: 0 additions & 1 deletion AltCover.DotNet/Options.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace AltCoverFake.DotNet.Testing

open System
open System.Diagnostics.CodeAnalysis
open System.Linq

[<RequireQualifiedAccess>]
module Options =
Expand Down
12 changes: 6 additions & 6 deletions AltCover.Engine/AltCover.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace AltCoverFake.DotNet.Testing
with
interface Abstract.IPrepareOptions
///<summary>
/// Corresponds to command line option ` -i, --inputDirectory=VALUE`
/// Corresponds to command line option `-i, --inputDirectory=VALUE`
///</summary>
member InputDirectories : System.String list
///<summary>
Expand All @@ -185,7 +185,7 @@ namespace AltCoverFake.DotNet.Testing
///</summary>
member Dependencies : System.String list
///<summary>
/// Corresponds to command line option ` -k, --key=VALUE`
/// Corresponds to command line option `-k, --key=VALUE`
///</summary>
member Keys : System.String list
///<summary>
Expand Down Expand Up @@ -213,7 +213,7 @@ namespace AltCoverFake.DotNet.Testing
///</summary>
member TypeFilter : System.String list
///<summary>
/// Corresponds to command line option ` -m, --methodFilter=VALUE`
/// Corresponds to command line option `-m, --methodFilter=VALUE`
///</summary>
member MethodFilter : System.String list
///<summary>
Expand Down Expand Up @@ -293,23 +293,23 @@ namespace AltCoverFake.DotNet.Testing
///</summary>
member LocalSource : bool
///<summary>
/// Corresponds to command line option ` -v, --visibleBranches`
/// Corresponds to command line option `-v, --visibleBranches`
///</summary>
member VisibleBranches : bool
///<summary>
/// Corresponds to command line option `--showstatic[=VALUE]`
///</summary>
member ShowStatic : string
///<summary>
/// Corresponds to command line option ` --showGenerated`
/// Corresponds to command line option `--showGenerated`
///</summary>
member ShowGenerated : bool
///<summary>
/// Corresponds to command line options `-q` and `--verbose`
///</summary>
member Verbosity : System.Diagnostics.TraceLevel
///<summary>
/// Corresponds to command line option ` --trivia`
/// Corresponds to command line option `--trivia`
///</summary>
member Trivia: bool with get
// ```
Expand Down
1 change: 1 addition & 0 deletions AltCover.Engine/Augment.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Augment =
#else
module internal Augment =
#endif
let nullObject: System.Object = null

#if !ValidateGendarmeEmulation
[<SuppressMessage("Microsoft.Globalization",
Expand Down

0 comments on commit 3ba64d6

Please sign in to comment.