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
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ updates:
directory: "/"
schedule:
interval: "weekly"
# G-Research.FSharp.Analyzers 0.23.0 is built with fsharp-analyzers 0.37.2.
# Do not update the host until G-Research ships a compatible rule package.
# G-Research.FSharp.Analyzers 0.25.0 is built with fsharp-analyzers 0.39.0, so only the
# 0.39.0 host loads it (the CLI requires an exact SDK match). Do not adopt another host
# version until G-Research ships a rule package built against that SDK.
ignore:
- dependency-name: "fsharp-analyzers"
versions: ["0.38.0"]
versions: ["0.38.0", "0.39.1", "0.39.2"]
commit-message:
prefix: "chore"
prefix-development: "chore"
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ sources, tests, `fable-out/`, `fable_modules/`, `bin/`, `obj/`, and maps exclude
Beyond our own product analyzer, the repo runs the [fsharp-analyzers](https://g-research.github.io/fsharp-analyzers/) rule set over our written F# via a dedicated CI job (`fsharp-analyzers` in `.github/workflows/ci.yml`). It is wired through MSBuild:

- `Directory.Build.props` adds `FSharp.Analyzers.Build` (the `AnalyzeFSharpProject` target) and `G-Research.FSharp.Analyzers` (the rules), and sets `RunAnalyzers=false` so these external rules never fire during Fable transpilation — the check is driven only through the explicit target.
- `Directory.Build.targets` sets `FSharpAnalyzersOtherFlags` (`--analyzers-path`, `--code-root`, `--report`). The rule package version in that path (currently `0.23.0`) must match the SDK the rules were built against; pair it with matching tooling versions in `.config/dotnet-tools.json` (`fsharp-analyzers`), or the CLI refuses to load the analyzer DLL on an SDK-version mismatch.
- `Directory.Build.targets` sets `FSharpAnalyzersOtherFlags` (`--analyzers-path`, `--code-root`, `--report`). The rule package version in that path (currently `0.25.0`) must match the SDK the rules were built against; pair it with matching tooling versions in `.config/dotnet-tools.json` (`fsharp-analyzers`), or the CLI refuses to load the analyzer DLL on an SDK-version mismatch.
- `Directory.Build.*` are evaluated for every project, so their XML must be valid: **XML comments may not contain `--`** (write "the analyzers-path flag", not `--analyzers-path` inside a comment) — otherwise every project fails MSBuild evaluation and no SARIF is produced.
- The `fsharp-analyzers` dotnet tool (0.37.2) is restored by the existing `dotnet tool restore` step; run it locally with `just fsharp-analyze [paths]`.
- The `fsharp-analyzers` dotnet tool (0.39.0) is restored by the existing `dotnet tool restore` step; run it locally with `just fsharp-analyze [paths]`.

The job is **soft-gated**: the `AnalyzeFSharpProject` target ignores the CLI exit code, so findings never fail the build, and a real restore/build/analysis error surfaces via the "Verify analyzer report exists" step (which fails loudly) instead of being hidden. A SARIF uploads per project to GitHub Code Scanning for triage over time. To make it blocking once the backlog clears, change the verify step to fail when results are non-empty.

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
code-root makes SARIF positions relative to the repo root; report writes one SARIF per
project under fsharp-analyzer-reports/ (git-ignored) for CI code-scanning upload.
-->
<FSharpAnalyzersOtherFlags>--analyzers-path "$(NuGetPackageRoot)g-research.fsharp.analyzers/0.23.0/analyzers/dotnet/fs" --code-root "$(MSBuildProjectDirectory)/.." --report "$(MSBuildProjectDirectory)/../fsharp-analyzer-reports/$(MSBuildProjectName).sarif"</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>--analyzers-path "$(NuGetPackageRoot)g-research.fsharp.analyzers/0.25.0/analyzers/dotnet/fs" --code-root "$(MSBuildProjectDirectory)/.." --report "$(MSBuildProjectDirectory)/../fsharp-analyzer-reports/$(MSBuildProjectName).sarif"</FSharpAnalyzersOtherFlags>
</PropertyGroup>
</Project>