Skip to content

Commit

Permalink
Bump fsharp-analyzers from 0.16.0 to 0.28.0 in /ApiSurface (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Dec 9, 2024
1 parent de4c713 commit 97f8988
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"fsharp-analyzers": {
"version": "0.16.0",
"version": "0.28.0",
"commands": [
"fsharp-analyzers"
]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ApiSurface/ApiMember.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<obj>

// Don't print `= ` for empty strings, as many editors/Git hooks trim trailing whitespace
if value = "" then
Expand Down
6 changes: 3 additions & 3 deletions ApiSurface/ApiSurface.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ApiSurface
namespace ApiSurface

open System
open System.IO.Abstractions
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions analyzers/analyzers.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<IsPublishable>false</IsPublishable>
<RestorePackagesPath>../.analyzerpackages/</RestorePackagesPath> <!-- Changes the global packages folder-->
<!-- <MSBuildProjectExtensionsPath>$(RestorePackagesPath)obj/</MSBuildProjectExtensionsPath> --> <!-- It's still PackageReference, so project intermediates are still created. -->
<TargetFramework>net6.0</TargetFramework> <!-- This is not super relevant, as long as your SDK version supports it. -->
<TargetFramework>net8.0</TargetFramework> <!-- This is not super relevant, as long as your SDK version supports it. -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder> <!-- If a package is resolved to a fallback folder, it may not be downloaded.-->
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages> <!-- We don't want to build this project, so we do not need the reference assemblies for the framework we chose.-->
</PropertyGroup>

<ItemGroup>
<PackageDownload Include="G-Research.FSharp.Analyzers" Version="[0.1.5]" />
<PackageDownload Include="G-Research.FSharp.Analyzers" Version="[0.12.0]" />
</ItemGroup>

</Project>
Expand Down

0 comments on commit 97f8988

Please sign in to comment.