SquatchStyle.Analyzers 1.0.3

dotnet add package SquatchStyle.Analyzers --version 1.0.3
                    
NuGet\Install-Package SquatchStyle.Analyzers -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SquatchStyle.Analyzers" Version="1.0.3">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SquatchStyle.Analyzers" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="SquatchStyle.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SquatchStyle.Analyzers --version 1.0.3
                    
#r "nuget: SquatchStyle.Analyzers, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SquatchStyle.Analyzers@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SquatchStyle.Analyzers&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=SquatchStyle.Analyzers&version=1.0.3
                    
Install as a Cake Tool

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

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 74 4/19/2026
1.0.2 74 4/19/2026
1.0.1 71 4/19/2026
1.0.0 82 4/18/2026