Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "file=$(jq -r '.tool_input.file_path'); case \"$file\" in *.fs|*.fsx|*.fsi) dotnet fantomas \"$file\" >/dev/null 2>&1 ;; esac; exit 0"
}
]
}
]
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [8.0.0-beta-001] - 2026-09-01

### Changed

- `=`, `>`, `<`, `%` and `%%` cannot start a line at the column of their left-hand side: there the parser reads `=`, `>` and `<` as the `=` of a binding, and reads `%` and `%%` inside a quotation as a splice. Fantomas already kept them off that column, but did so with the layout that keeps the right-hand side beside the operator whenever it is short enough to fit, which needs the page width and a column count to predict and moves a `0` around when an unrelated part of the line changes length. It now follows the rule proposed in [fsharp/fslang-design#836](https://github.com/fsharp/fslang-design/issues/836): the expression fits on one line, or it does not and the operator stays with the left-hand side while the right-hand side moves one level in, or the left-hand side itself spans several lines, in which case the operator and the right-hand side each take a line of their own. `fsharp_multiline_bracket_style = stroustrup` still overrides this for a right-hand side that opens a bracket, which keeps hugging the operator. This is the first beta of `8.0.0`: the style guide for this is not settled yet, so give it a try and report back on [the design issue](https://github.com/fsharp/fslang-design/issues/836) if something reads worse than what it replaces. [#3434](https://github.com/fsprojects/fantomas/pull/3434)

## [8.0.0-alpha-026] - 2026-08-29

### Changed
Expand Down
9 changes: 5 additions & 4 deletions src/Fantomas.Core.Tests/AlignedMultilineBracketStyleTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1499,10 +1499,11 @@ let compareThings (first: Thing) (second: Thing) =
equal
"""
let compareThings (first : Thing) (second : Thing) =
first = { second with
Foo = first.Foo
Bar = first.Bar
}
first =
{ second with
Foo = first.Foo
Bar = first.Bar
}
"""

// `Aligned` copy-and-update expression keeps label on first line to match G-Research style guide.
Expand Down
7 changes: 4 additions & 3 deletions src/Fantomas.Core.Tests/CrampedMultilineBracketStyleTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2145,9 +2145,10 @@ let compareThings (first: Thing) (second: Thing) =
equal
"""
let compareThings (first: Thing) (second: Thing) =
first = { second with
Foo = first.Foo
Bar = first.Bar }
first =
{ second with
Foo = first.Foo
Bar = first.Bar }
"""

[<Test>]
Expand Down
1 change: 1 addition & 0 deletions src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<Compile Include="CommentTests.fs" />
<Compile Include="ShebangTests.fs" />
<Compile Include="OperatorTests.fs" />
<Compile Include="NoBreakInfixOperatorTests.fs" />
<Compile Include="ComparisonTests.fs" />
<Compile Include="ControlStructureTests.fs" />
<Compile Include="PipingTests.fs" />
Expand Down
4 changes: 3 additions & 1 deletion src/Fantomas.Core.Tests/IfThenElseTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,9 @@ if
UriComponents.Host ||| UriComponents.Path,
UriFormat.UriEscaped,
StringComparison.CurrentCulture
) = 0
)
=
0
then
()
else
Expand Down
Loading
Loading