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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"rollForward": false
},
"fsharp-analyzers": {
"version": "0.38.0",
"version": "0.39.0",
"commands": [
"fsharp-analyzers"
],
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.25.0] - 2026-09-10

### Changed

- Update FSharp.Analyzers.SDK to `0.39.0`. [#116](https://github.com/G-Research/fsharp-analyzers/pull/116)

## [0.24.0] - 2026-09-05

### Changed
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>
<ItemGroup>
<!-- locking the version of F# Core as FCS does this anyway and in practise all will be using the same version -->
<PackageVersion Include="FSharp.Analyzers.SDK" Version="[0.38.0]" />
<PackageVersion Include="FSharp.Analyzers.SDK.Testing" Version="[0.38.0]" />
<PackageVersion Include="FSharp.Analyzers.SDK" Version="[0.39.0]" />
<PackageVersion Include="FSharp.Analyzers.SDK.Testing" Version="[0.39.0]" />
<PackageVersion Include="FSharp.Core" Version="[10.1.400]" />
<PackageVersion Include="FSharp.Compiler.Service" Version="[43.12.400]" />
<PackageVersion Include="Ionide.KeepAChangelog.Tasks" Version="0.3.3" />
Expand Down
17 changes: 2 additions & 15 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#r "nuget: Humanizer.Core"

open System
open System.Collections.Generic
open System.IO
open System.Text.RegularExpressions
open System.Xml.Linq
open Fun.Build
open Humanizer
Expand All @@ -25,18 +23,8 @@ let buildStage =
let analyzersProject =
__SOURCE_DIRECTORY__ </> "src/FSharp.Analyzers/FSharp.Analyzers.fsproj"

/// Every analyzer code (GRA-XXX-000) declared in the analyzer sources.
let analyzerCodes () =
let codes = HashSet<string> ()

for file in Directory.EnumerateFiles (Path.GetDirectoryName analyzersProject, "*.fs") do
for m in Regex.Matches (File.ReadAllText file, "\"(GRA-[A-Z0-9-]+)\"") do
codes.Add m.Groups.[1].Value |> ignore

codes

/// Runs the analyzers built by this repository over its own source. Requires buildStage to have run first.
/// The tool exits 0 on warnings, so every known code is escalated to an error to make findings fail the stage.
/// The tool exits 0 on warnings, so every GRA- code is escalated to an error to make findings fail the stage.
let analyzeStage =
stage "analyze" {
run (fun ctx ->
Expand All @@ -52,11 +40,10 @@ let analyzeStage =
| Ok targetPath ->

let analyzersPath = Path.GetDirectoryName (targetPath.Trim ())
let treatAsError = analyzerCodes () |> String.concat " "

return!
ctx.RunCommand
$"dotnet fsharp-analyzers --project \"%s{analyzersProject}\" --analyzers-path \"%s{analyzersPath}\" --treat-as-error %s{treatAsError}"
$"dotnet fsharp-analyzers --project \"%s{analyzersProject}\" --analyzers-path \"%s{analyzersPath}\" --treat-as-error \"GRA-*\""
}
)
}
Expand Down