-
-
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
Incorrect async indentation when inside of a match #2501
Comments
Hey there, Well, this opens a wonderful new can of worms😔 So, without the addition newline you would have something like: | Some packageRegistrationUrl ->
async { formatted to | Some packageRegistrationUrl -> async { I assume Maxime you added the new line deliberately? //cc @josh-degraw |
@nojaf What's do you think will the best way to handle this? Could we add a check inside e.g. |
Well, I'm afraid the problem is two folded:
We might be able to check these conditions in @MangelMaxime, do note that adding the additional newline deliberately is forcing Fantomas to behave inconsistently. If you are working in a team, another team member would not have made this decision, leading to the entire codebase being a mixed bag. |
@nojaf This probably merits discussion in the style guide repo, but when formatting my team's codebase it brought me back to this issue. I wonder if for Stroustrup we actually should either always put computation expression names on their own line, or have an option to prefer that. I'd actually lean towards the first at the moment to be honest. I personally think that this: let private extractMissingHeaders (error: CsvHelper.HeaderValidationException) =
seq {
for m in Regex.Matches (error.Message, "Header with name '([a-zA-Z]+)", RegexOptions.None) do
yield m.Groups.[1].Value
} is more readable than this: let private extractMissingHeaders (error: CsvHelper.HeaderValidationException) = seq {
for m in Regex.Matches (error.Message, "Header with name '([a-zA-Z]+)", RegexOptions.None) do
yield m.Groups.[1].Value
} But, aside from the personal preference, there's a logical reason to prefer the first as well. Stroustrup is about brackets, whereas this brings the first line of the whole expression to the first line. Changing to the first form here still has the |
I had similar thoughts on this, let's discuss this further on Thursday. |
Issue created from fantomas-online
Code
Result
Problem description
The
async {
is not indented using 4 spaces but 2 spaces only.Extra information
Options
Fantomas master branch at 2022-09-11T16:37:09Z - 7fb34e5
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered: