SquatchStyle.Analyzers
1.0.3
dotnet add package SquatchStyle.Analyzers --version 1.0.3
NuGet\Install-Package SquatchStyle.Analyzers -Version 1.0.3
<PackageReference Include="SquatchStyle.Analyzers" Version="1.0.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="SquatchStyle.Analyzers" Version="1.0.3" />
<PackageReference Include="SquatchStyle.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add SquatchStyle.Analyzers --version 1.0.3
#r "nuget: SquatchStyle.Analyzers, 1.0.3"
#:package SquatchStyle.Analyzers@1.0.3
#addin nuget:?package=SquatchStyle.Analyzers&version=1.0.3
#tool nuget:?package=SquatchStyle.Analyzers&version=1.0.3
SquatchStyle
Squatch Style — Tiger Style, but for F#
SquatchStyle is an F# analyzer library that enforces TigerStyle coding discipline — a safety-first philosophy originally written for Zig and TigerBeetle's financial database. SquatchStyle adapts these principles to idiomatic F#.
Priority order: Safety → Performance → Developer Experience
Rules
| Code | Name | Severity | Suppressible |
|---|---|---|---|
| SS001 | SilentErrorDiscard | Error | No |
| SS002 | FunctionLength | Warning ≥55 / Error ≥70 | No |
| SS003 | MutableBinding | Warning | Yes |
| SS004 | UnguardedRecursion | Error | No |
| SS005 | WildcardPattern | Warning | No |
| SS006 | MissingDocumentation | Hint | No |
| SS007 | RawException | Warning | Yes |
| SS008 | MagicLiteral | Warning | No |
See docs/RULES.md for full descriptions, examples, and fixes.
Installation
Add the analyzer to your .fsproj:
<ItemGroup>
<PackageReference Include="SquatchStyle.Analyzers" Version="*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
You will need to configure the analyzers to run as needed on your project. Since these aren't native to the F# community (unlike Roslyn analyzers), you'll need some setup in your project. Instructions can be found here
CI Escalation
Promote warnings to errors in CI:
<PropertyGroup Condition="'$(CI)' == 'true'">
<WarningsAsErrors>SS003;SS005;SS006;SS007;SS008</WarningsAsErrors>
</PropertyGroup>
Suppressions
Two rules support justified suppressions via inline comments. The justification is required — a bare marker won't compile.
// squatch:allow-mutable Performance-critical accumulator in hot path.
let mutable acc = 0
// squatch:allow-exception Invariant: count is always non-negative after Decrement.
if count < 0 then failwith "Invariant violated"
SS001, SS002, and SS004 cannot be suppressed — they represent hard safety constraints.
Build
dotnet fsi build.fsx build # compile
dotnet fsi build.fsx test # run tests
dotnet fsi build.fsx pack # produce NuGet package
dotnet fsi build.fsx all # clean → restore → build → test → pack
License
MIT — Copyright 2026 Andrew Morger
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- FSharp.Analyzers.SDK (>= 0.36.0)
- FSharp.Core (>= 10.0.101)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.