ijrussell / essential-fsharp

Markdown source of Essential F# ebook
MIT License
110 stars 13 forks source link

Format all code using Fantomas #14

Closed cmeeren closed 2 months ago

cmeeren commented 7 months ago

I propose that all code in the book should be formatted using Fantomas. It's the de facto way of formatting F#. It would help the community if resources like this provide a standard code style.

cmeeren commented 7 months ago

Personally I consistently use the default Fantomas settings except the two changes below in my .editorconfig:

[*.fs]
# Reduces indentation, makes editing easier, simplifies diffs
fsharp_multiline_bracket_style = stroustrup
# Makes formatting of lambdas consistent with other constructs, and is in line with the stroustrup style above
fsharp_multi_line_lambda_closing_newline = true
ianrussellsoftwarepark commented 2 months ago

I agree with the sentiment but I'm not sure that I have the time to go through all of the code. I will add a section on fantomas and how to use it.