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

Code style for the project #2

Open
TatianaJin opened this issue Sep 26, 2018 · 0 comments
Open

Code style for the project #2

TatianaJin opened this issue Sep 26, 2018 · 0 comments
Labels
good first issue Good for newcomers

Comments

@TatianaJin
Copy link
Member

The code style of this project follows that of the Husky system.

Naming conventions

The variable names (including class instance names) are lowercase words concatenated by underscores (e.g. a_valid_var_name). For the member variables of classes, if the variable is private or protected, the name should end with an underscore (e.g. private_member_var_name_).

The class names are in camel case (e.g. class ValidClassName {};).

The function names (including member functions of a class) are lowercase words concatenated by underscores (e.g. void a_valid_func_name() {}).

Includes

The #include s should be grouped and sorted within each group. The following highlights the grouping orders.

  • If the current file is a cpp file (e.g. example.cpp) and it has a header file (e.g. example.hpp), this header file should be included first as a separate group
  • Includes of stl headers
  • Includes of third-party headers
  • Includes of husky headers
  • Includes of heads in the current project

Example

In example.cpp

#include "relative_to_project_root/example.hpp"

#include <string> // included from stl, sorted alphabetically
#include <vector>

#include "orc/ColumnPrinter.hh"  // third-party

#include "io/input/file_splitter_base.hpp"  // included from husky 

#include "husky-plugins/core/constants.hpp" // in the current project
@TatianaJin TatianaJin added the good first issue Good for newcomers label Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant