diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e4939f3..1cbedeb 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "fsharp-analyzers": { - "version": "0.16.0", + "version": "0.28.0", "commands": [ "fsharp-analyzers" ] diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml index 6be35b9..75fef14 100644 --- a/.github/workflows/dotnet.yaml +++ b/.github/workflows/dotnet.yaml @@ -71,7 +71,8 @@ jobs: - name: Restore dependencies run: dotnet restore ./ApiSurface/ApiSurface.fsproj - name: Run analyzers - run: dotnet fsharp-analyzers --project ./ApiSurface/ApiSurface.fsproj --analyzers-path ./.analyzerpackages/g-research.fsharp.analyzers/*/ --verbose --report ./analysis.sarif --fail-on-warnings GRA-STRING-001 GRA-STRING-002 GRA-STRING-003 GRA-UNIONCASE-001 + run: dotnet fsharp-analyzers --project ./ApiSurface/ApiSurface.fsproj --analyzers-path ./.analyzerpackages/g-research.fsharp.analyzers/*/ --verbosity detailed --report ./analysis.sarif --treat-as-error GRA-STRING-001 GRA-STRING-002 GRA-STRING-003 GRA-UNIONCASE-001 GRA-INTERPOLATED-001 GRA-TYPE-ANNOTATE-001 GRA-VIRTUALCALL-001 GRA-IMMUTABLECOLLECTIONEQUALITY-001 GRA-JSONOPTS-001 GRA-LOGARGFUNCFULLAPP-001 GRA-DISPBEFOREASYNC-001 --exclude-analyzers PartialAppAnalyzer + - name: Upload SARIF file uses: github/codeql-action/upload-sarif@v3 with: diff --git a/ApiSurface/ApiMember.fs b/ApiSurface/ApiMember.fs index 9348f77..d4f5c71 100644 --- a/ApiSurface/ApiMember.fs +++ b/ApiSurface/ApiMember.fs @@ -68,7 +68,7 @@ module ApiMember = let typeString = fieldType |> Type.toFullName if fieldInfo.IsLiteral then - let value = m.DeclaringType.GetField(m.Name).GetValue null |> string + let value = m.DeclaringType.GetField(m.Name).GetValue null |> string // Don't print `= ` for empty strings, as many editors/Git hooks trim trailing whitespace if value = "" then diff --git a/ApiSurface/ApiSurface.fs b/ApiSurface/ApiSurface.fs index c4dd13d..fc65978 100644 --- a/ApiSurface/ApiSurface.fs +++ b/ApiSurface/ApiSurface.fs @@ -1,4 +1,4 @@ -namespace ApiSurface +namespace ApiSurface open System open System.IO.Abstractions @@ -255,8 +255,8 @@ module ApiSurface = // on first run to make SurfaceBaseline.txt rather than the most specific possible. let baselinePath = possibleBaselineResources - |> Seq.tryFind File.Exists - |> Option.defaultValue (Seq.last possibleBaselineResources) + |> List.tryFind File.Exists + |> Option.defaultValue (List.last possibleBaselineResources) let versionFile = match versionFiles with diff --git a/analyzers/analyzers.fsproj b/analyzers/analyzers.fsproj index a6d2c95..8ca8592 100644 --- a/analyzers/analyzers.fsproj +++ b/analyzers/analyzers.fsproj @@ -5,13 +5,13 @@ false ../.analyzerpackages/ - net6.0 + net8.0 true false - +