Skip to content
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

Formatting guidelines: clarify how empty class, struct and interface declarations should be formatted #28103

Closed
Shuenhoy opened this issue Feb 7, 2022 · 3 comments · Fixed by #37860
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-fsharp/svc help wanted Good for community contributors to help [up-for-grabs] mvp-docs-sprint For tracking purposes (used for the MVP summit docs sprint hack). Pri2

Comments

@Shuenhoy
Copy link

Shuenhoy commented Feb 7, 2022

How empty class, struct and interface declarations should be formatted is missing in current docs.
I would prefer a one-line style:

type AnEmptyClass = class end

instead of

type AnEmptyClass =
    class
    end

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@BillWagner
Copy link
Member

@dsyme which style do you prefer?

@dsyme
Copy link
Contributor

dsyme commented May 11, 2022

The first. cc @nojaf for comment

@nojaf
Copy link
Contributor

nojaf commented May 12, 2022

This works for me, I don't see any real problems.
One edge cases that might be reported in Fantomas would be the following:

module A =
    module B =
        module C =
            module D =
                module E =
                    type SuperLooooooooooooonnnnggggggggggTypeNameeeeeeeeeeeeeeeeForNooooooooooGoooooooooodReason = class end

In that scenario, this would cross the max_line_length.
Highly unlikely to appear in the wild I think.
@dsyme perhaps this should be mentioned that regardless of the chosen page width, it should always be = class end on the same line.

@BillWagner BillWagner added help wanted Good for community contributors to help [up-for-grabs] doc-enhancement Improve the current content [org][type][category] labels Nov 28, 2022
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Nov 28, 2022
@IEvangelist IEvangelist added the mvp-docs-sprint For tracking purposes (used for the MVP summit docs sprint hack). label Apr 4, 2023
@ghost ghost added the in-pr This issue will be closed (fixed) by an active pull request. label Nov 2, 2023
@ghost ghost removed the in-pr This issue will be closed (fixed) by an active pull request. label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-fsharp/svc help wanted Good for community contributors to help [up-for-grabs] mvp-docs-sprint For tracking purposes (used for the MVP summit docs sprint hack). Pri2
Projects
None yet
7 participants