-
-
Notifications
You must be signed in to change notification settings - Fork 39
Code style
Eugene Kirpichov edited this page May 19, 2020
·
11 revisions
For C++, we generally follow the [Google C++ Style Guide].
Per above, we intend to follow the Google style guide: classes LikeThis
, functions and methods LikeThis()
(trivial methods like_this()
), local variables like_this
, and class member variables like_this_
. As of writing, this is not enforced, but we intend to enforce it.
We autoformat both C++ and Python code: c++ using clang-format
, Python using black
.
Make sure you install our pre-commit hooks: they will reformat your code on commit, and error out if any changes were made (in that case, simply amend your commit with the formatting changes).
- take this plugin https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
- point it to the clang-format binary at
~/.cache/pre-commit-jlebar