Analyzers
Ranvier.Analyzers reports Ranvier traps at build time, at the source range of the cause. Each code below links to its cause, its fix and an example.
| Code | Title | Severity | Scope |
|---|---|---|---|
| RAN001 | Fable inlines a snapshot of a module mutable | Warning | Fable |
| RAN002 | Generated union case tester in a Fable library | Warning | Fable |
| RAN010 | Owned node created in a pure derivation | Error | Ranvier |
| RAN011 | Async value created and read in the owner that replaces it | Warning | Ranvier |
| RAN012 | Reactive read after the first await of an async memo | Warning | Ranvier |
| RAN013 | Signal write or Pump on a thread-pool callback | Warning | Ranvier |
| RAN015 | CancelPrevious with a body that ignores its token | Hint | Ranvier |
| RAN020 | Reactive read at template build time | Warning | view |
| RAN021 | Unstable list key | Warning / Info | view |
| RAN022 | Definition created on every region read | Warning | view |
| RAN023 | Invalid content parts on an element | Error | view |
| RAN024 | Markup the server render refuses | Warning | view |
| RAN025 | hydrateWith with queued commits | Error | view |
Where the rules run
Ranvier rules run in a project that references
Ranvier.view rules run in a project that references
Ranvier.VieworRanvier.View.Dom, or compiles their sources, such as the view projects of this repository.Fable rules run in a project that Fable compiles. Every Ranvier project references Fable.Core, so the rules read the project's own signals instead:
- a tool manifest (
.config/dotnet-tools.json, searched upward to the first root manifest) that declaresfableorfickl; - a
Fable.*package reference in the project file; <RanvierFableAnalyzers>true</RanvierFableAnalyzers>, for a global,--tool-pathordotnet dnxinstall of Fable.
A .NET-only project gets neither RAN001 nor RAN002. RAN002 also needs a declared
fablebefore 5.22, or no declared compiler.- a tool manifest (
Running the analyzers
In this repository, after dotnet build Ranvier.slnx -c Release:
dotnet fsi build.fsx -- analyze
The command builds the analyzers, runs them over the repository's projects with every code promoted to an error, and writes a SARIF report per project group to artifacts/analyzers. A project that sets <RanvierAnalyze>true</RanvierAnalyze> reports them in its own dotnet build output after each compile.
Suppression
Write the reason on the line before the SDK's comment:
// The snapshot is read before any write, so Fable's inlining leaves the value unchanged.
// fsharpanalyzer: ignore-line-next RAN001
let setups = Loops.childSetups
ignore-line, ignore-region-start/ignore-region-end and ignore-file take the same codes.
Columns
The CLI's console output, and the dotnet build warnings made from it, count columns from 0: B.fs(4,8) is the identifier at the ninth character of line 4. The SARIF report, and the CI annotations made from it, count from 1.