-
Notifications
You must be signed in to change notification settings - Fork 463
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
Code style: Do not indent namespace #2917
Comments
I'm.ok with a formatter. I have no opinions on style. IIRC @nschonni has
looked at this in the past.
…On Wed., 19 Jun. 2019, 9:49 am Gleb Mazovetskiy, ***@***.***> wrote:
Indenting the contents of namespace { ... } is rather uncommon.
Can we stop doing this in all new code?
Examples:
GCC Coding Conventions,
https://gcc.gnu.org/codingconventions.html#Namespace_Form:
Definitions within the body of a namespace are not indented.
LLVM Coding Standards,
https://llvm.org/docs/CodingStandards.html#namespace-indentation:
In general, we strive to reduce indentation wherever possible. [...] To
facilitate this and avoid some insanely deep nesting on occasion, don’t
indent namespaces.
Google C++ Style Guide,
https://google.github.io/styleguide/cppguide.html#Namespace_Formatting:
The contents of namespaces are not indented.
------------------------------
On a more general note, can we simply configure clang-format and use it
for all the code to get consistent formatting?
Humans are pretty bad at consistent formatting. Currently the formatting
is currently all over the place, making code hard to read. Using
clang-format will free us from having to worry about formatting at all.
We can use the Google C++ clang-format style (which IMO is pretty good).
We can configure clang-format and run it on all existing code, now that
there are no huge outstanding PRs.
@mgreter <https://github.com/mgreter> @xzyfer <https://github.com/xzyfer>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2917?email_source=notifications&email_token=AAENSWC6X2GZGFXB33NHE6DP3HQHHA5CNFSM4HZG2LR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2KL44Q>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAENSWAMV6UUMZ66DDCUTSTP3HQHHANCNFSM4HZG2LRQ>
.
|
I took a shot at clang-format in #2324, but my cpp is pretty limited, so I've got no strong opinions on what style to use. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Indenting the contents of
namespace { ... }
is rather uncommon.Can we stop doing this in all new code?
Examples:
GCC Coding Conventions, https://gcc.gnu.org/codingconventions.html#Namespace_Form:
LLVM Coding Standards, https://llvm.org/docs/CodingStandards.html#namespace-indentation:
Google C++ Style Guide, https://google.github.io/styleguide/cppguide.html#Namespace_Formatting:
On a more general note, can we simply configure clang-format and use it for all the code to get consistent formatting?
Humans are pretty bad at consistent formatting. Currently the formatting is all over the place, making code hard to read. Using clang-format will free us from having to worry about formatting at all.
We can use the Google C++ clang-format style (which IMO is pretty good).
We can configure clang-format and run it on all existing code, now that there are no huge outstanding PRs.
@mgreter @xzyfer
The text was updated successfully, but these errors were encountered: