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

Update .clang-format #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Language: Cpp
BasedOnStyle: Google

ColumnLimit: 120
ColumnLimit: 80
NamespaceIndentation: Inner

# Scaled by a factor of 2 such that the base indent is 4
AccessModifierOffset: -2
AccessModifierOffset: -3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Google's style "indent by one", or "indent by half indent width"?

I have always interpreted it as the latter, but have never checked.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://google.github.io/styleguide/cppguide.html#Class_Format says "indent by 1", though of course they also say "indent by 2". FWIW, https://github.com/google/styleguide complains about private/public/etc being 2, but not about the overall indent being 4.

IndentWidth: 4
...
1 change: 0 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ Format

* Our format is based on `Google C++ style guide <https://google.github.io/styleguide/cppguide.html>`_ with some exceptions:

- Column width is limited to 120 characters. Best effort should be made to keep to 80 characters, but up to 120 can be used for clarity.
- The base indent level is 4.
- Non-const references are allowed.

Expand Down