Open knocte opened 3 years ago
I would like to point out that the recommendation has a 'vanity' indentation problem I believe.
foobar
and foorbarbaz
are indented with 20 spaces in the example and I think that is determined by the length of the word failwith
.
If it were failwithSuperLongBananas
, the indentation would increase because of the function name.
failwithSuperLongBananas <| sprintf "foobar: %s - foobarbaz: %s"
foobar
foobarbaz
where
failwithSuperLongBananas
<| sprintf "foobar: %s - foobarbaz: %s" foobar foobarbaz
does not have this problem.
@cmeeren, @pragmatrix, @lydell this is the place do discuss these things ;)
For reference, the Fantomas issue mentioning vanity indentation: https://github.com/fsprojects/fantomas/issues/659
@nojaf What do you mean by
this is the place do discuss these things ;)
Are you saying that the Fantomas repo is not the place to discuss the issue @lydell linked to above, and that unless this is rectified in the official style guidelines, vanity indentation won't be changed in Fantomas?
If so, remember, the guidelines are just that, guidelines :)
(Mandatory Captain Barbossa meme)
In any case, I think the linked issue pretty much sums up why vanity indentation might not be a good idea.
failwithSuperLongBananas
<| sprintf "foobar: %s - foobarbaz: %s" foobar foobarbaz
Makes me giggle but I suppose it's the least friction. Happy to accept a PR!
@cmeeren, style needs to discussed over here and what gets in this style guide gets in Fantomas. Sorry for the burden Phillip ;)
Issue description
Advice is given about how to use forward pipeline operators
|>
(chaining them by putting an EOL character next to them on the left side), e.g.However, what to do with reverse pipeline operators? Splitting them in the same way looks odd, e.g.:
So I recommend that an example is given which looks like the following:
Document details added by adegeo
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.