Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.1.25",
"version": "5.4.12",
"commands": [
"reportgenerator"
]
],
"rollForward": false
},
"dotnet-fsharplint": {
"version": "0.21.3",
"version": "0.26.2",
"commands": [
"dotnet-fsharplint"
]
],
"rollForward": false
},
"altcode.gendarme-tool": {
"version": "2023.8.26.15512",
"version": "2024.6.28.12460",
"commands": [
"gendarme"
]
],
"rollForward": false
}
}
}
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5.0.0
with:
fetch-depth: 2
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.400'
global-json-file: global.json
cache: true
cache-dependency-path: |
**/*.csproj
**/*.fsproj
**/packages.lock.json
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down
3 changes: 1 addition & 2 deletions Build/actions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ module Actions =
let Clean () =
let rec clean1 depth =
try
(DirectoryInfo ".")
.GetDirectories("*", SearchOption.AllDirectories)
(DirectoryInfo ".").GetDirectories("*", SearchOption.AllDirectories)
|> Seq.filter (fun x ->
x.Name.StartsWith "_"
|| x.Name = "bin"
Expand Down
1 change: 0 additions & 1 deletion Build/setup.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ module Setup =

let Preparation =
(fun _ ->
RestoreMSSolutionPackages restore "./altcode.dixon.sln"
Directory.ensure "./packages/fxcop/"

let target =
Expand Down
24 changes: 12 additions & 12 deletions Build/targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ module Targets =
let now = DateTime.Now

let time =
now
.ToString("HHmmss")
.Substring(0, 5)
.TrimStart('0')
let raw = now.ToString("HHmmss").Substring(0, 5).TrimStart('0')
if String.IsNullOrEmpty raw then
"0"
else
raw

let y0 = now.Year
let m0 = now.Month
Expand Down Expand Up @@ -382,7 +383,7 @@ module Targets =

let Restore =
(fun _ ->
(!! "./**/*.*proj")
(!!"./**/*.*proj")
|> Seq.iter (fun f ->
let dir = Path.GetDirectoryName f
let proj = Path.GetFileName f
Expand All @@ -403,10 +404,10 @@ module Targets =
proj))

let BuildRelease =
(fun _ -> "./altcode.dixon.sln" |> msbuildRelease)
(fun _ -> "./altcode.dixon.slnx" |> msbuildRelease)

let BuildDebug =
(fun _ -> "./altcode.dixon.sln" |> msbuildDebug)
(fun _ -> "./altcode.dixon.slnx" |> msbuildDebug)

// Code Analysis

Expand All @@ -430,9 +431,8 @@ module Targets =
let failOnIssuesFound (issuesFound: bool) =
Assert.That(issuesFound, Is.False, "Lint issues were found")

[ !! "./**/*.fsproj"
|> Seq.sortBy (Path.GetFileName)
!! "./Build/*.fsx" |> Seq.map Path.GetFullPath ]
[ !!"./**/*.fsproj" |> Seq.sortBy (Path.GetFileName)
!!"./Build/*.fsx" |> Seq.map Path.GetFullPath ]
|> Seq.concat
|> Seq.map doLintAsync
|> throttle
Expand Down Expand Up @@ -759,7 +759,7 @@ module Targets =
printfn "Overall coverage reporting"
Directory.ensure "./_Reports/_BulkReport"

!! "./_Reports/*.xml"
!!"./_Reports/*.xml"
|> Seq.filter (fun f ->
not
<| f.EndsWith("Report.xml", StringComparison.OrdinalIgnoreCase))
Expand All @@ -780,7 +780,7 @@ module Targets =
|> String.IsNullOrWhiteSpace
|> not
then
(!! "./_Packagin*/*.nupkg")
(!!"./_Packagin*/*.nupkg")
|> Seq.iter (fun f ->
printfn "Publishing %A from %A" f currentBranch

Expand Down
46 changes: 23 additions & 23 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ItemGroup>
<PackageVersion Include="AltCode.Dixon" Version="2022.1.8.13182" />
<PackageVersion Include="AltCode.Fake.DotNet.Gendarme" Version="5.23.0.42" />
<PackageVersion Include="altcode.gendarme" Version="2023.8.26.15512" />
<PackageVersion Include="altcode.gendarme" Version="2024.6.28.12460" />
<PackageVersion Include="altcover" Version="8.6.68" />
<PackageVersion Include="AltCover.Api" Version="8.5.841" />
<PackageVersion Include="AltCover.Fake" Version="8.5.841" />
Expand All @@ -12,42 +12,42 @@
<PackageVersion Include="CommunityToolkit.Diagnostics" Version="8.0.0" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="CsvTextFieldParser" Version="1.2.2-preview" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<PackageVersion Include="Expecto" Version="9.0.4" />
<PackageVersion Include="Expecto.FsCheck" Version="9.0.4" />
<PackageVersion Include="Expecto.TestResults" Version="8.13.2" />
<PackageVersion Include="FAKE.Core.Environment" Version="5.23.0" />
<PackageVersion Include="FAKE.Core.Process" Version="5.23.0" />
<PackageVersion Include="FAKE.Core.Target" Version="5.23.0" />
<PackageVersion Include="FAKE.Core.Environment" Version="6.1.3" />
<PackageVersion Include="FAKE.Core.Process" Version="6.1.3" />
<PackageVersion Include="FAKE.Core.Target" Version="6.1.3" />
<PackageVersion Include="FAKE.Core.Trace" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.AssemblyInfoFile" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.Cli" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.FxCop" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.MSBuild" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.Nuget" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.Testing.NUnit" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.Testing.OpenCover" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.Testing.XUnit2" Version="5.23.0" />
<PackageVersion Include="FAKE.IO.FileSystem" Version="5.23.0" />
<PackageVersion Include="FAKE.Tools.Git" Version="5.23.0" />
<PackageVersion Include="FAKE.Testing.ReportGenerator" Version="5.23.0" />
<PackageVersion Include="FAKE.DotNet.AssemblyInfoFile" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.Cli" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.FxCop" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.MSBuild" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.Nuget" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.Testing.NUnit" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.Testing.OpenCover" Version="6.1.3" />
<PackageVersion Include="FAKE.DotNet.Testing.XUnit2" Version="6.1.3" />
<PackageVersion Include="FAKE.IO.FileSystem" Version="6.1.3" />
<PackageVersion Include="FAKE.Tools.Git" Version="6.1.3" />
<PackageVersion Include="FAKE.Testing.ReportGenerator" Version="6.1.3" />
<PackageVersion Include="FsCheck" Version="2.16.5" />
<PackageVersion Include="FSharp.Core" Version="7.0.400" />
<PackageVersion Include="FSharp.Core" Version="9.0.303" />
<PackageVersion Include="FsUnit" Version="5.1.0" />
<!-- PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" / -->
<PackageVersion Include="Markdown" Version="2.2.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="16.0.0" />
<PackageVersion Include="Mono.Cecil" Version="0.11.4" />
<PackageVersion Include="Mono.Options" Version="6.12.0.148" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="NuGet.CommandLine" Version="6.7.0" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NuGet.CommandLine" Version="6.14.0" />
<PackageVersion Include="NUnit" Version="4.4.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.0" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.16.3" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.20.1" />
<PackageVersion Include="OpenCover" Version="4.7.1221" />
Comment on lines +48 to 51
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

NUnit 4 vs NUnit 3 infrastructure mismatch likely to break test execution

You upgraded NUnit to 4.4.0 but still use NUnit3TestAdapter and nunit3-console (ConsoleRunner 3.x). NUnit 3 adapters/runners don’t execute NUnit 4 tests.

Two paths:

  • Revert to NUnit 3.x to keep the current infra (NUnit3TestAdapter + ConsoleRunner 3.x).
  • Or migrate the test infra to NUnit 4 compatible tooling (adapter/console that supports v4).

If you prefer to revert for now, change these lines:

-    <PackageVersion Include="NUnit" Version="4.4.0" />
+    <PackageVersion Include="NUnit" Version="3.13.3" />
     <PackageVersion Include="NUnit3TestAdapter" Version="4.3.0" />
-    <PackageVersion Include="NUnit.ConsoleRunner" Version="3.20.1" />
+    <PackageVersion Include="NUnit.ConsoleRunner" Version="3.20.1" />

If you want to proceed with NUnit 4, I can propose the compatible adapter/runner set.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<PackageVersion Include="NUnit" Version="4.4.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.0" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.16.3" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.20.1" />
<PackageVersion Include="OpenCover" Version="4.7.1221" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.0" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.20.1" />
<PackageVersion Include="OpenCover" Version="4.7.1221" />
🤖 Prompt for AI Agents
In Directory.Packages.props around lines 48-51, NUnit was bumped to 4.4.0 while
the project still references NUnit3TestAdapter and NUnit.ConsoleRunner 3.x
(NUnit 3 infra), which will prevent tests from running; either revert NUnit to a
3.x release that is compatible with the current adapter/console (e.g., set NUnit
to a 3.13.x stable version) or update the test infrastructure to NUnit
4-compatible tooling (replace NUnit3TestAdapter and ConsoleRunner 3.x with the
NUnit 4 adapter/engine and console packages that support v4); pick one path and
update the versions in this file so the framework and runners/adapters match.

<PackageVersion Include="Pester" Version="5.3.3" />
<PackageVersion Include="PowerShellStandard.Library" Version="5.1.1" />
Expand All @@ -66,7 +66,7 @@
<PackageVersion Include="xunit.extensibility.execution" Version="2.4.2" />
<PackageVersion Include="xunit.runner.console" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="YamlDotNet" Version="12.0.2" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="YoloDev.Expecto.TestSdk" Version="1.0.0" />
</ItemGroup>
</Project>
47 changes: 0 additions & 47 deletions FakeForAltCodeDixonBuild.sln

This file was deleted.

18 changes: 18 additions & 0 deletions FakeForAltCodeDixonBuild.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".config/dotnet-tools.json" />
<File Path=".github/workflows/main.yml" />
<File Path="Build/build-rules.xml" />
<File Path="Build/Directory.Build.props" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="OutputBuildProps.props" />
<File Path="OutputBuildTargets.props" />
<File Path="README.md" />
<File Path="ReleaseNotes - Previously.md" />
<File Path="ReleaseNotes.md" />
</Folder>
<Project Path="Build/Build.fsproj" />
<Project Path="Build/Setup.fsproj" />
Comment on lines +3 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify referenced paths exist and that actions/checkout is bumped to v5 in workflows

This manifest references many files (including .github/workflows/main.yml). Let’s verify all referenced paths resolve and that workflows use actions/checkout@v5 and suitable runners.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking that all referenced .slnx paths exist..."
python - << 'PY'
import xml.etree.ElementTree as ET, glob, os, sys
slnx_files = glob.glob('**/*.slnx', recursive=True)
missing = []
for slx in slnx_files:
    tree = ET.parse(slx)
    root = tree.getroot()
    for elem in root.iter():
        if elem.tag in ('File','Project'):
            p = elem.get('Path')
            if p and not os.path.exists(p):
                missing.append((slx, p))
        if elem.tag == 'BuildDependency':
            p = elem.get('Project')
            if p and not os.path.exists(p):
                missing.append((slx, p))
if missing:
    print('Missing paths referenced in .slnx:')
    for slx, p in missing:
        print(f'  {slx}: {p}')
    sys.exit(1)
print('All referenced paths in .slnx exist.')
PY

echo
echo "Inspecting actions/checkout usage in workflows..."
if fd -t f -g '.github/workflows/*.yml' >/dev/null 2>&1; then
  echo "All checkout usages (context lines shown):"
  rg -nP --no-heading -C2 '\buses:\s*actions/checkout@[^ \t]+' .github/workflows || true
  echo
  echo "Checking for non-v5 usages of actions/checkout..."
  if rg -nP --no-heading '\buses:\s*actions/checkout@(?!v5(?:\b|\.))\S+' .github/workflows >/dev/null; then
    echo "Found non-v5 usages of actions/checkout:"
    rg -nP --no-heading -C1 '\buses:\s*actions/checkout@(?!v5(?:\b|\.))\S+' .github/workflows
    exit 2
  else
    echo "All actions/checkout usages are v5 (or none found)."
  fi
  echo
  echo "Runner targets:"
  rg -nP --no-heading '^\s*runs-on\s*:' .github/workflows || true
else
  echo "No workflow files found at .github/workflows/*.yml"
fi

Length of output: 330


Missing file references in altcode.dixon.slnx

The solution manifest is referencing Build/*.fsx files that don’t exist in the repo:

  • Build/actions.fsx
  • Build/build.fsx
  • Build/setup.fsx
  • Build/targets.fsx

These must either be added to version control or their <File> entries removed from altcode.dixon.slnx.

Once the manifest is corrected, also verify that your GitHub workflows in .github/workflows/*.yml:

  • Use actions/checkout@v5
  • Specify appropriate runs-on runner targets

</Solution>
4 changes: 1 addition & 3 deletions FixCop/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ let main argv =
let verbose =
System.Diagnostics.TraceLevel.Verbose

catrace
.GetProperty("TraceLevel")
.SetValue(null, verbose)
catrace.GetProperty("TraceLevel").SetValue(null, verbose)

// interop info
let cainterop =
Expand Down
4 changes: 4 additions & 0 deletions ToolUpdate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
& dotnet tool update dotnet-reportgenerator-globaltool
& dotnet tool update altcode.gendarme-tool
& dotnet tool update dotnet-fsharplint
& dotnet tool update -g fantomas
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make tool updates deterministic and fail fast; bind to the local tool manifest explicitly

As written, failures won’t stop the script, and updates depend on the current working directory implicitly containing the manifest. Tighten reliability and reproducibility.

Apply this diff to add strict error handling, pin to the local manifest, and keep the global fantomas update:

+Set-StrictMode -Version Latest
+$ErrorActionPreference = "Stop"
+
+Push-Location $PSScriptRoot
+try {
-& dotnet tool update dotnet-reportgenerator-globaltool
-& dotnet tool update altcode.gendarme-tool
-& dotnet tool update dotnet-fsharplint
-& dotnet tool update -g fantomas
+  & dotnet tool restore --tool-manifest .\.config\dotnet-tools.json
+  & dotnet tool update --tool-manifest .\.config\dotnet-tools.json dotnet-reportgenerator-globaltool
+  & dotnet tool update --tool-manifest .\.config\dotnet-tools.json altcode.gendarme-tool
+  & dotnet tool update --tool-manifest .\.config\dotnet-tools.json dotnet-fsharplint
+  & dotnet tool update -g fantomas
+}
+finally {
+  Pop-Location
+}
🤖 Prompt for AI Agents
In ToolUpdate.ps1 lines 1-4, the script currently runs updates
non-deterministically and won’t stop on failures; change it to set PowerShell to
fail fast (e.g. $ErrorActionPreference = 'Stop' at the top) and update the local
tools by explicitly targeting the repository tool manifest (use the --local and
--tool-manifest <path> flags, e.g. --local --tool-manifest
.config/dotnet-tools.json) for the first three updates, while keeping the
fantomas update global (-g); ensure each dotnet invocation relies on those flags
so failures cause the script to exit immediately.

71 changes: 0 additions & 71 deletions altcode.dixon.sln

This file was deleted.

Loading
Loading