Description
We ran the latest version of Fantomas on our code and have a list of minor issues we have with the formatting style. Some of these may well be due to our incorrect config and we are going to be double checking to see if that is the case of some of these.
To begin with, here are our config settings:
fsharp_space_before_uppercase_invocation=true
fsharp_space_before_class_constructor=true
fsharp_space_before_member=true
fsharp_space_before_colon=true
fsharp_space_before_semicolon=true
fsharp_indent_on_try_with=true
fsharp_multiline_block_brackets_on_same_column=true
fsharp_newline_between_type_definition_and_members=true
fsharp_align_function_signature_to_indentation=true
fsharp_alternative_long_member_definitions=true
1. Casting operator not being treated like other pipe operators
What we had:
Reflection.invokeStaticGenericMethod
<@ someFunctionHere @>
[someParameterHere]
[someMoreParemetersHere]
:?>
What fantomas did:
Reflection.invokeStaticGenericMethod
<@ someFunctionHere @>
[ someParameterHere ]
[ someMoreParemetersHere ] :?>
What we wanted:
Reflection.invokeStaticGenericMethod
<@ someFunctionHere @>
[ someParameterHere ]
[ someMoreParemetersHere ]
:?>
2. List function parameter formatting
What we had:
someFunctionHere [parameters] [yetMoreParameters]
:?> _
What fantomas did:
someFunctionHere [ parameters ] [
yetMoreParameters
] :?> _
What we wanted:
someFunctionHere
[ parameters ]
[ yetMoreParameters ]
:?> _
3. Formatting a list of tuples that didn't hit out line limit
What we had:
[MyType.ofPartialThing path, leafObject]
What fantomas did:
[
MyType.ofPartialThing path, leafObject
]
What we wanted:
[ MyType.ofPartialThing path, leafObject ]
4. Ending parenthesis for lambda functions passed into HOFs
What we had:
List.collect (fun (a, element) ->
let path' = path |> someFunctionToCalculateThing
innerFunc<'a, 'b> path' element (foo >> bar value >> List.item a) shape)
What fantomas did:
List.collect (fun (a, element) ->
let path' =
path
|> someFunctionToCalculateThing
innerFunc<'a, 'b>
path'
element
(foo >> bar value >> List.item a)
shape)
What we wanted:
List.collect (fun (a, element) ->
let path' =
path
|> someFunctionToCalculateThing
innerFunc<'a, 'b>
path'
element
(foo >> bar value >> List.item a)
shape
)
5. Tuple formatting when not near line limit
What we had:
| Leaf.Func getFunc -> iterator.Iterate (path, getFunc >> fun f -> f.Invoke)
What fantomas did:
| Leaf.Func getFunc ->
iterator.Iterate
(path,
getFunc
>> fun f -> f.Invoke)
What we wanted:
| Leaf.Func getFunc ->
iterator.IterProv
(path, getFunc >> fun f -> f.Invoke)
or
| Leaf.Func getFunc ->
iterator.IterProv
(path,
getFunc >> fun f -> f.Invoke)
6. More Tuple formatting
What we had
|> Seq.map (Tuple.rmap (MyLongLeafPath.toInnerPath >> InnerPathType.toHumanReadableString))
|> Seq.map (fun (added, str) -> sprintf "%s - %s" (if added then addedString else removedString) str)
What fantomas did
|> Seq.map
(Tuple.rmap
(MyLongLeafPath.toInnerPath
>> InnerPathType.toHumanReadableString))
|> Seq.map (fun (added, str) -> sprintf "%s - %s" (if added then addedString else removedString) str)
What we wanted:
|> Seq.map
(Tuple.rmap
(MyLongLeafPath.toInnerPath >> InnerPathType.toHumanReadableString)
)
|> Seq.map (fun (added, str) -> sprintf "%s - %s" (if added then addedString else removedString) str)
7. More parameter spacing
What we had:
InstanceObject.make [a; b; c]
What fantomas did:
InstanceObject.make [ a
b
c ]
What we wanted:
InstanceObject.make
[a ; b ; c]
8. Constructor formatting
What we had:
new ParquetWriter(
file.FullName,
Column.Thing
WriteProperties.make columns,
dict metadata |> Dictionary
)
What fantomas did:
new ParquetWriter( file.FullName,
Column.Thing
WriteProperties.make columns,
dict metadata |> Dictionary)
What we wanted:
new ParquetWriter(
file.FullName,
Column.Thing
WriteProperties.make columns,
dict metadata |> Dictionary
)
Will update this as I check to make sure these aren't already solved by config we aren't using.
Thanks,
Jack