val | description |
---|---|
None | 使用しない |
Cpp | C, C++, Objective-C, Objective-C++ を使用する |
Java | Java を使用する |
JavaScript | JavaScript を使用する |
Proto | Protocol Buffers |
class CFoo : public CSuperFoo { public: CFoo(int ini_a, char* ini_b) : m_a(ini_a), m_b(ini_b), m_c{} {} private: char* m_b; uint64_t m_c; };
class CFoo : public CSuperFoo { public: CFoo(int ini_a, char* ini_b) : m_a(ini_a), m_b(ini_b), m_c{} {} private: int m_a; char* m_b; uint64_t m_c; };
class CFoo : public CSuperFoo { public: CFoo(int ini_a, char* ini_b) : m_a(ini_a), m_b(ini_b), m_c{} {} private: int m_a; char* m_b; uint64_t m_c; };
// 仮引数は、カラム上限にかかった場合に改行される。仮引数の整列はアリ void func_c(std::string& hoge_name, std::vector<std::string>& name_list, std::vector<uint64_t> param_list) { uint32_t local_count(0); for (std::vector<std::string>::iterator it_of_name_list = name_list.begin(); it_of_name_list != name_list.end(); ++it_of_name_list) { uint32_t ret = sub_func(hoge_name, *it_of_name_list, param_list, local_count); ++local_count; } // カラム上限に達していなければ改行されない for (uint32_t i = 1; i < max_count; ++i) { sub_func_2(hoge_name, name_list, param_list); } }
// 仮引数は、カラム上限にかかった場合に改行される。仮引数の整列はナシ void func_c(std::string& hoge_name, std::vector<std::string>& name_list, std::vector<uint64_t> param_list) { uint32_t local_count(0); for (std::vector<std::string>::iterator it_of_name_list = name_list.begin(); it_of_name_list != name_list.end(); ++it_of_name_list) { uint32_t ret = sub_func(hoge_name, *it_of_name_list, param_list, local_count); ++local_count; } // カラム上限に達していなければ改行されない for (uint32_t i = 1; i < max_count; ++i) { sub_func_2(hoge_name, name_list, param_list); } }
// 仮引数は、先頭と、カラム上限にかかった場合に改行される。結果的に整列されたに等しくなる。 void func_c( std::string& hoge_name, std::vector<std::string>& name_list, std::vector<uint64_t> param_list) { uint32_t local_count(0); for (std::vector<std::string>::iterator it_of_name_list = name_list.begin(); it_of_name_list != name_list.end(); ++it_of_name_list) { uint32_t ret = sub_func(hoge_name, *it_of_name_list, param_list, local_count); ++local_count; } // カラム上限に達していなければ改行されない for (uint32_t i = 1; i < max_count; ++i) { sub_func_2(hoge_name, name_list, param_list); } }
int32_t var_1 = 12; std::string var_2 = "foo"; const char* const var_3 = "bar";
int32_t var_1 = 12; std::string var_2 = "foo"; const char* const var_3 = "bar";
int32_t var_11 = 12; std::string var_2 = "foo"; const char* const var_3 = "bar";
int32_t var_11 = 12; std::string var_2 = "foo"; const char* const var_3 = "bar";
#define LOG_PREFIX \ "[DEBUG]" \ "[MODULE_A]" \ "[MOD_SUB_2]"
// ColumnLimit: 80 の場合 #define LOG_PREFIX \ "[DEBUG]" \ "[MODULE_A]" \ "[MOD_SUB_2]"
if (arg > 10) { var_11 += arg; }
if (arg > 10) { var_11 += arg; }
st_aaa aaa = { 0, };
style | style option |
---|---|
LLVM | BasedOnStyle: LLVM |
BasedOnStyle: Google | |
Chromium | BasedOnStyle: Chromium |
Mozilla | BasedOnStyle: Mozilla |
WebKit | BasedOnStyle: WebKit |
linux | BasedOnStyle: LLVM |
IndentWidth: 8 | |
UseTab: Always | |
BreakBeforeBraces: Linux | |
AllowShortIfStatementsOnASingleLine: false | |
IndentCaseLabels: false | |
Visual Studio | UseTab: Never |
IndentWidth: 4 | |
BreakBeforeBraces: Allman | |
AllowShortIfStatementsOnASingleLine: false | |
IndentCaseLabels: false | |
ColumnLimit: 0 |
// 波括弧は常に周囲のコンテキストにくっつける。 enum HOGE_EN { EN_AAA, EN_ABC, EN_ZZZ, }; struct st_aaa { int aaa[2]; uint64_t ax; }; void func(int arg) { // ... if (arg == 0) { // ... } else { // ... } return; }
// Attach に似るが、関数や名前空間、クラス定義の前は改行する。 enum HOGE_EN { EN_AAA, EN_ABC, EN_ZZZ, }; struct st_aaa { int aaa[2]; uint64_t ax; }; void func(int arg) { // ... if (arg == 0) { // ... } else { // ... } return; }
// Attach と似るが、 enum、関数定義などの前には改行する。 enum HOGE_EN { EN_AAA, EN_ABC, EN_ZZZ, }; struct st_aaa { int aaa[2]; uint64_t ax; }; void func(int arg) { // ... if (arg == 0) { // ... } else { // ... } return; }
// Attach と似るが、catch, else などの前は改行する。 enum HOGE_EN { EN_AAA, EN_ABC, EN_ZZZ, }; struct st_aaa { int aaa[2]; uint64_t ax; }; void func(int arg) { // ... if (arg == 0) { // ... } else { // ... } return; }
// 波括弧の前は全て改行する。 enum HOGE_EN { EN_AAA, EN_ABC, EN_ZZZ, }; struct st_aaa { int aaa[2]; uint64_t ax; }; void func(int arg) { // ... if (arg == 0) { // ... } else { // ... } return; }
// 波括弧の前は全て改行するし、新たにインデントを加える。但し、クラス定義や関数定義などの場合は除く。 enum HOGE_EN { EN_AAA, EN_ABC, EN_ZZZ, }; struct st_aaa { int aaa[2]; uint64_t ax; }; void func(int arg) { // ... if (arg == 0) { // ... } else { // ... } return; }