Fantomas.Core
8.0.0-alpha-017
dotnet add package Fantomas.Core --version 8.0.0-alpha-017
NuGet\Install-Package Fantomas.Core -Version 8.0.0-alpha-017
<PackageReference Include="Fantomas.Core" Version="8.0.0-alpha-017" />
<PackageVersion Include="Fantomas.Core" Version="8.0.0-alpha-017" />
<PackageReference Include="Fantomas.Core" />
paket add Fantomas.Core --version 8.0.0-alpha-017
#r "nuget: Fantomas.Core, 8.0.0-alpha-017"
#:package Fantomas.Core@8.0.0-alpha-017
#addin nuget:?package=Fantomas.Core&version=8.0.0-alpha-017&prerelease
#tool nuget:?package=Fantomas.Core&version=8.0.0-alpha-017&prerelease
Fantomas

An opinionated F# source code formatter.
dotnet tool install fantomas
Documentation is available at https://fsprojects.github.io/fantomas/docs/index.html
If you point a coding agent at Fantomas, give it llms.txt for an index of the documentation, or llms-full.txt for all of it in one file.
Contributing Guidelines
See the Contribution Guidelines and our contributors documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Fantomas.FCS (>= 8.0.0-alpha-017)
- FSharp.Core (>= 10.0.100)
- System.Collections.Immutable (>= 10.0.6)
- System.Diagnostics.DiagnosticSource (>= 10.0.6)
- System.Memory (>= 4.6.3)
- System.Runtime (>= 4.3.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Fantomas.Core:
| Package | Downloads |
|---|---|
|
Myriad.Core
Core Myriad library used for developing plugins |
|
|
Fantomas.Extras
Utility package for Fantomas |
|
|
WoofWare.Whippet.Fantomas
Helpers for accessing Fantomas syntax trees. |
|
|
Fabulous.AST
Fabulous.AST, an Abstract Syntax Tree (AST) Domain Specific Language (DSL) for F#. |
|
|
Partas.Feliz.Generator
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.0-alpha-017 | 0 | 8/25/2026 |
| 8.0.0-alpha-016 | 0 | 8/25/2026 |
| 8.0.0-alpha-015 | 39 | 8/24/2026 |
| 8.0.0-alpha-014 | 53 | 8/20/2026 |
| 8.0.0-alpha-013 | 68 | 8/19/2026 |
| 8.0.0-alpha-012 | 145 | 4/16/2026 |
| 8.0.0-alpha-011 | 123 | 4/15/2026 |
| 8.0.0-alpha-010 | 121 | 4/15/2026 |
| 8.0.0-alpha-009 | 133 | 4/3/2026 |
| 8.0.0-alpha-008 | 143 | 3/25/2026 |
| 8.0.0-alpha-007 | 133 | 3/10/2026 |
| 8.0.0-alpha-006 | 126 | 3/9/2026 |
| 8.0.0-alpha-005 | 122 | 3/9/2026 |
| 8.0.0-alpha-004 | 123 | 3/7/2026 |
| 8.0.0-alpha-003 | 120 | 3/3/2026 |
| 8.0.0-alpha-002 | 3,392 | 12/15/2025 |
| 8.0.0-alpha-001 | 167 | 12/12/2025 |
| 7.0.6 | 543 | 8/19/2026 |
| 7.0.5 | 15,051 | 12/5/2025 |
| 7.0.4 | 281 | 12/5/2025 |
### Added
- `fantomas doctor <file>` walks one file through everything Fantomas does to it and reports what happened at each step: whether the path is a file Fantomas formats, which `.fantomasignore` governs it and which line of that file decided, which settings apply and which `.editorconfig` set each one, what formatting produced and where the result first parts from the file, whether Fantomas accepts its own output, and whether formatting that output again leaves it alone. It writes nothing, so it is safe against a working tree you have not committed. Every question it answers was answerable before only by reading two configuration formats by hand and knowing the order Fantomas resolves them in. It takes one file rather than a folder, because the answers differ per file, and it exits 0 for a file it could diagnose whatever it found, 1 for a path it cannot look at or a step that failed. `--json` writes the same walk as one document with a key per step. [#3421](https://github.com/fsprojects/fantomas/pull/3421)
- The `.fantomasignore` line that matched a path is now knowable rather than only the yes or no. `doctor` quotes it with its line number, the way `git check-ignore -v` does, and names every line that matches when more than one does, since a `!` pattern further down is exactly the case nobody spots by eye. [#3421](https://github.com/fsprojects/fantomas/pull/3421)
- `doctor` decides whether a file would be rewritten the way a format run decides it, by comparing the text as it is. A file whose line endings are the only thing out of step is therefore reported as needing formatting, where `fantomas check` deliberately overlooks that difference and calls the same file already formatted. What it reports is where the file and the result first part, rather than a count of the lines that differ by position: that is not a count of edits, because splitting one long line into five moves every line below it. [#3421](https://github.com/fsprojects/fantomas/pull/3421)
- A file under a folder a compiler or a package manager wrote, such as `obj`, is named as such by `doctor`. A run over the tree above it never opens that folder, whatever the ignore file says, and sending its owner to read their `.fantomasignore` sends them to read the wrong file. [#3421](https://github.com/fsprojects/fantomas/pull/3421)
### Changed
- Breaking: output that Fantomas will not accept from itself is reported as what it is, and shows you the part of that output it would not accept. `Fantomas produced code that is not valid F#.` read as though the file were at fault, and reaching it always means the opposite: the input parsed, or a parse failure would have been reported instead. The report now says that nothing was written and the file is untouched, that this is a bug in Fantomas rather than a problem with the code, and where to report it, in the shape a parse failure and an unmodellable construct already print. [#3419](https://github.com/fsprojects/fantomas/pull/3419)
- Breaking: that report carries what the parser said about the rejected output, and the lines of the output around it with a caret under the failure, so there is a small reproduction to cut from it. Up to now the run said only that something was invalid, and finding out what meant running again with `--force` and reading the result. The diagnostics carry no line and column of their own: the output they would count into is written nowhere, so a position in it is a coordinate you cannot follow, and a path an editor could open would take you to the wrong line of the right file. The carets say where, and the report says out loud that the lines below it are the output rather than your file. `--json` carries the same diagnostics in the `diagnostics` array a parse failure already uses. `fantomas check` reports all of it the same way, where it used to run the whole explanation on after `could not be checked:`. [#3419](https://github.com/fsprojects/fantomas/pull/3419)
- The two reports that ask you to file a bug, for output Fantomas would not accept and for a construct it cannot model, name one place to send it rather than two. They used to add the issue tracker as an alternative for a file too large for the online tool to carry, which offered a choice at the point somebody least wants one. [#3419](https://github.com/fsprojects/fantomas/pull/3419)
- Breaking: `Fantomas.Core.CodeFormatter.IsValidFSharpCodeAsync` became `ValidateFSharpCodeAsync` and answers with a `ValidationResult` rather than a `bool`. Read `.IsValid` off it where the verdict was all you wanted; `.Diagnostics` is what Fantomas refused, positioned, and is empty exactly when the source is valid. The boolean discarded it, so anything that had to say why had to parse the source a second time to find out, which is why the tool could not show you its own bad output. A warning Fantomas tolerates, such as [#3396](https://github.com/fsprojects/fantomas/issues/3396) on IWSAM types, is not among them. [#3419](https://github.com/fsprojects/fantomas/pull/3419)
### Fixed
- A `[<return: ...>]` attribute written in front of an `extern` declaration was dropped from the output. The parser moves such an attribute out of the binding's attribute list and into its arity information, and the `extern` path never looked there, so the line was silently deleted. Bindings already put those attributes back; `extern` now does the same. An attribute written on the return type itself, `extern [<MarshalAs(UnmanagedType.I1)>] bool f(int options)`, is reported in both places and stays where it was written. [#3420](https://github.com/fsprojects/fantomas/issues/3420)