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

Coding style in moose-core #285

Open
dilawar opened this issue Aug 17, 2018 · 1 comment
Open

Coding style in moose-core #285

dilawar opened this issue Aug 17, 2018 · 1 comment

Comments

@dilawar
Copy link
Contributor

dilawar commented Aug 17, 2018

Would it be helpful to use a fixed coding style to avoid various merge conflict due to different editor settings? If yes, we should pick a style which can be enforced by a tool, e.g. astyle can convert the file into various styles. Tool clang-formatter turns code into google style. Once we are settled on one format, I can run the tool on all files and send a PR with consistent formatting.

Tool astyle support following styles. I prefer -A1 (the first one) but I am OK with any of the following.

    --style=allman  OR  --style=bsd  OR  --style=break  OR  -A1
    Allman style formatting/indenting.
    Broken braces.

    --style=java  OR  --style=attach  OR  -A2
    Java style formatting/indenting.
    Attached braces.

    --style=kr  OR  --style=k&r  OR  --style=k/r  OR  -A3
    Kernighan & Ritchie style formatting/indenting.
    Linux braces.

    --style=stroustrup  OR  -A4
    Stroustrup style formatting/indenting.
    Linux braces.

    --style=whitesmith  OR  -A5
    Whitesmith style formatting/indenting.
    Broken, indented braces.
    Indented class blocks and switch blocks.

    --style=vtk  OR  -A15
    VTK style formatting/indenting.
    Broken, indented braces except for the opening braces.

    --style=ratliff  OR  --style=banner  OR  -A6
    Ratliff style formatting/indenting.
    Attached, indented braces.

    --style=gnu  OR  -A7
    GNU style formatting/indenting.
    Broken braces, indented blocks.

    --style=linux  OR  --style=knf  OR  -A8
    Linux style formatting/indenting.
    Linux braces, minimum conditional indent is one-half indent.

    --style=horstmann  OR  --style=run-in  OR  -A9
    Horstmann style formatting/indenting.
    Run-in braces, indented switches.

    --style=1tbs  OR  --style=otbs  OR  -A10
    One True Brace Style formatting/indenting.
    Linux braces, add braces to all conditionals.

    --style=google  OR  -A14
    Google style formatting/indenting.
    Attached braces, indented class modifiers.

    --style=mozilla  OR  -A16
    Mozilla style formatting/indenting.
    Linux braces, with broken braces for structs and enums,
    and attached braces for namespaces.

    --style=pico  OR  -A11
    Pico style formatting/indenting.
    Run-in opening braces and attached closing braces.
    Uses keep one line blocks and keep one line statements.

    --style=lisp  OR  -A12
    Lisp style formatting/indenting.
    Attached opening braces and attached closing braces.
    Uses keep one line statements.
@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant