-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] GR style tweaks #1189
Comments
Hey @JackMatusiewiczGR, Some initial feedback:
[]
|> Seq.map (
Tuple.rmap (
MyLongLeafPath.toInnerPath
>> InnerPathType.toHumanReadableString
)
)
|> Seq.map (fun (added, str) -> sprintf "%s - %s" (if added then addedString else removedString) str) in this case? Is it tuple versus lambda?
As we tackle some of these things, we should also update the style guide accordingly. Thanks for writing all of this down, much appreciated! |
I think what we need to resolve 4/6 is some more detailed style guidelines. I've documented our style in G-Research/fsharp-formatting-conventions#10 . I think your version is more consistent; let me know if you think the guidelines still don't pin down the right answer here. |
Number 7 was fixed by disabling the Elmish formatting. |
Re 8: I've raised a discussion over at G-Research/fsharp-formatting-conventions#11 about what the right thing to do here is. |
Re 4: I'd be interested in this too. |
Hey @JackMatusiewiczGR and @Smaug123, in regards to 4. innerFunc<'a, 'b>
path'
element
(foo >> bar value >> List.item a)
shape a function call is only multiline now if it cannot respect the max length boundary. |
That looks fine to me. There are cases where we sometimes split function calls across lines for clarity even if they would fit on one line, but nothing principled. |
I'm going to close this as most of the mentioned items have been resolved by now. |
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:
1. Casting operator not being treated like other pipe operators
What we had:
What fantomas did:
What we wanted:
2. List function parameter formatting
What we had:
What fantomas did:
What we wanted:
3. Formatting a list of tuples that didn't hit out line limit
What we had:
What fantomas did:
What we wanted:
4. Ending parenthesis for lambda functions passed into HOFs
What we had:
What fantomas did:
What we wanted:
5. Tuple formatting when not near line limit
What we had:
What fantomas did:
What we wanted:
or
6. More Tuple formatting
What we had
What fantomas did
What we wanted:
7. More parameter spacing
What we had:
What fantomas did:
What we wanted:
8. Constructor formatting
What we had:
What fantomas did:
What we wanted:
Will update this as I check to make sure these aren't already solved by config we aren't using.
Thanks,
Jack
The text was updated successfully, but these errors were encountered: