-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Review long function definitions #946
Comments
@Smaug123 @JackMatusiewiczGR suggestions for a setting name are welcome. |
I think |
What about using a different (well, third already) approach: do double indent for signature continuation and then a single indent for the right-side block? let internal UpdateStrongNaming (assembly: AssemblyDefinition)
(key: StrongNameKeyPair option) =
assembly.Name I've initially seen this style in Kotlin and really like how it fits in various F# parts too, e.g: match foo with
| Some x when
someExpressionHere ||
andAnotherOne ->
printfn "%O" x
| _ -> () |
Hmm, I'm not entirely convinced here. I feel like the alignment of the parameters we currently have in the other styles is more readable, to be honest. |
Making it double-indent makes it consistent regardless of what was on the previous line, so in this particular case it doesn't matter how long the function name is, you'll see the next parameters at the same indent in any case (and most likely will have much more space in the line left). |
This is what the GR style guide proposes, regardless of the name the indent will be one in this case. |
I propose that Fantomas formats long function definitions by default as described by the Microsoft style guide and place the GR style behind a setting.
The existing way of Fantomas deals with this problem is using the G-Research style guide.
Pros and Cons
The advantages of making this adjustment to Fantomas are that we respect both style guides.
The disadvantages of making this adjustment to Fantomas are an extra setting to maintain.
Examples
Please provide multiple examples (before and after scenarios) and explain what rules did apply to achieve the outcome.
Microsoft:
G-Research
Extra information
Estimated cost: S
Related suggestions: #935, #492, #769
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
The text was updated successfully, but these errors were encountered: