FsHotWatch.Fantomas 0.3.0-alpha.1

This is a prerelease version of FsHotWatch.Fantomas.
dotnet add package FsHotWatch.Fantomas --version 0.3.0-alpha.1
                    
NuGet\Install-Package FsHotWatch.Fantomas -Version 0.3.0-alpha.1
                    
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="FsHotWatch.Fantomas" Version="0.3.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHotWatch.Fantomas" Version="0.3.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="FsHotWatch.Fantomas" />
                    
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 FsHotWatch.Fantomas --version 0.3.0-alpha.1
                    
#r "nuget: FsHotWatch.Fantomas, 0.3.0-alpha.1"
                    
#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 FsHotWatch.Fantomas@0.3.0-alpha.1
                    
#: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=FsHotWatch.Fantomas&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FsHotWatch.Fantomas&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Tool

FsHotWatch.Fantomas

Plugin and preprocessor for Fantomas formatting. This package provides two components:

  1. FormatPreprocessor -- automatically formats files on save (before other plugins see the change)
  2. FormatCheckPlugin -- reports which files are not properly formatted (read-only, for CI)

Why

Running dotnet fantomas on every save is slow because it starts a new process each time. The FormatPreprocessor runs in-process and formats only the changed files, so formatting happens in milliseconds.

The preprocessor runs before other plugins receive the FileChanged event, so format-on-save doesn't re-trigger the entire pipeline.

How it works

FormatPreprocessor (format-on-save):

  1. You save a file
  2. FormatPreprocessor receives the changed files before other plugins
  3. It formats each file with Fantomas in-process
  4. If the file changed, it writes the formatted version
  5. The daemon suppresses re-trigger events for files the preprocessor wrote

FormatCheckPlugin (format check):

  1. A file change event reaches the plugin
  2. It formats the file in memory and compares with the original
  3. Unformatted files are tracked and reported to the error ledger

Configuration

In .fs-hot-watch.json:

{
  "format": true
}

Set "format": false to disable the format-on-save preprocessor. The format check plugin always runs alongside the preprocessor.

CLI

# Format all files
fs-hot-watch format

# Query which files are unformatted
fs-hot-watch unformatted

Programmatic usage

From the FullPipelineExample:

// Format-on-save preprocessor (runs before other plugins)
daemon.RegisterPreprocessor(FormatPreprocessor())

// Read-only format check plugin (reports unformatted files)
daemon.RegisterHandler(
    FormatCheckPlugin.createFormatCheck
        None   // getCommitId for caching
)

Install

dotnet add package FsHotWatch.Fantomas
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in 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
0.3.0-alpha.1 33 4/8/2026
0.1.0-alpha.1 44 4/3/2026