fantomas 8.0.0-alpha-018

This is a prerelease version of fantomas.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global fantomas --version 8.0.0-alpha-018
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local fantomas --version 8.0.0-alpha-018
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=fantomas&version=8.0.0-alpha-018&prerelease
                    
nuke :add-package fantomas --version 8.0.0-alpha-018
                    

Fantomas

Fantomas logo

GitHub Workflow Status (event) Discord Nuget (with prereleases) llms.txt llms-full.txt

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 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.

This package has no dependencies.

Version Downloads Last Updated
8.0.0-alpha-026 0 8/29/2026
8.0.0-alpha-025 63 8/28/2026
8.0.0-alpha-024 37 8/28/2026
8.0.0-alpha-023 48 8/28/2026
8.0.0-alpha-022 271 8/27/2026
8.0.0-alpha-021 37 8/27/2026
8.0.0-alpha-020 53 8/27/2026
8.0.0-alpha-019 377 8/26/2026
8.0.0-alpha-018 40 8/26/2026
8.0.0-alpha-017 276 8/25/2026
8.0.0-alpha-016 440 8/25/2026
8.0.0-alpha-015 220 8/24/2026
8.0.0-alpha-014 125 8/20/2026
8.0.0-alpha-013 114 8/19/2026
8.0.0-alpha-012 7,120 4/16/2026
8.0.0-alpha-011 175 4/15/2026
8.0.0-alpha-010 171 4/15/2026
8.0.0-alpha-009 337 4/3/2026
8.0.0-alpha-008 178 3/25/2026
7.0.6 4,538 8/19/2026
Loading failed

### Added

- `doctor` names the `.fantomasignore` above the one that governs a file, when a pattern in it would have skipped that file. Fantomas reads the nearest ignore file at or above a file and no other, so a pattern written at the root of a repository has no effect on a folder that has an ignore file of its own beside it. Up to now the report named the ignore file that did decide and said nothing about the one that did not, which answers "which file" and leaves "then why did mine not" for the reader to work out. It quotes the pattern that would have matched, with its line number, the way it already quotes the line that decided. `--json` carries every ignore file above the governing one under `shadowed`, each with `wouldIgnore` and the lines of it that match, whether or not it would have decided anything. [#3423](https://github.com/fsprojects/fantomas/pull/3423)

### Changed

- The settings that ask for a space before the parenthesis of a call, `fsharp_space_before_uppercase_invocation` and `fsharp_space_before_lowercase_invocation`, now get a say only when the whole thing being called is a plain dotted name. Put a call, an index, a bracketed receiver, or a type application anywhere in it, and the parenthesis stays tight whatever the settings ask for. On default settings `xs.map(fun a -> a + 1).filter (fun a -> a > 1)` becomes `xs.map(fun a -> a + 1).filter(fun a -> a > 1)`, which is the report this started from, and `Foo().bar ()` and `myList.[7].someFunction (arg)` lose their space for the same reason. A plain dotted name is untouched however long it gets, so `List.map (f)` and `Fantomas.FCS.Text.Range.unionRanges (r1, r2)` keep the space they had, and so is a literal or type parameter receiver, since `"yow".Substring (0, 3)` and `'T.set_StaticProperty (3)` are atomic rather than bracketed. Agreed at [fslang-design#648](https://github.com/fsharp/fslang-design/issues/648) and written up under [Formatting chain expressions](https://fsprojects.github.io/fantomas/docs/contributors/Chains.html). [#3425](https://github.com/fsprojects/fantomas/pull/3425)
- A type application now makes a call tight with no chain in sight, which is the part of the change above most likely to catch you out, because it reaches ordinary generic calls rather than fluent code. On default settings `unbox<bool> (value)`, `f<int> (x)`, `List.map<int> (f)` and `jsOptions<Vis.Options> (fun o -> ...)` all lose their space, since `fsharp_space_before_lowercase_invocation` is `true` and each of those is a lower-case name carrying type arguments. An upper-case generic call such as `Dictionary<string, int>(x)` was already tight by default and only moves if `fsharp_space_before_uppercase_invocation` is on. Fantomas does not add parentheses, so the far more common form without them, `unbox<int> obj`, is left exactly as written and never comes into it. [#3425](https://github.com/fsprojects/fantomas/pull/3425)

### Fixed

- More expression forms count as open-ended, so a record, list, array or tuple that holds one of them in a non-last position stays multiline instead of collapsing onto a line that means something else. [#3279](https://github.com/fsprojects/fantomas/issues/3279) settled `fun`, `if`, `match` and `try`, and left the forms that wrap one of those or end in one: `lazy`, `yield`, `return`, `do`, `assert` and `fixed`, an assignment such as `x.P <- fun y -> y`, and `let x = 1 in body`. `{ A = 1; B = lazy fun x -> x; C = 3 }` reads back as a lambda that swallowed `C = 3`. A wrapper around something that closes on its own, `lazy a` or `x.P <- 1`, collapses as it always did. When this happens, why, and how to get the single line back is written up under [Open-ended expressions](https://fsprojects.github.io/fantomas/docs/end-users/OpenEndedExpressions.html). [#3424](https://github.com/fsprojects/fantomas/pull/3424)