相关疑难解决方法(0)

clang-format:如果语句溢出,则将参数和参数强制为one-line-each

有没有办法强制参数和参数为单行 - 如果一个或多个字符超过溢出?

例如:

例如,这个:

if(value != "course" || value != "module" || value != "lesson"
)
Run Code Online (Sandbox Code Playgroud)

应该是这样的:

if(value != "course" ||
   value != "module" ||
   value != "lesson")
Run Code Online (Sandbox Code Playgroud)

或这个:

if(value != "course"
|| value != "module"
|| value != "lesson")
Run Code Online (Sandbox Code Playgroud)

还有这个:

void some_class::some_func(const std:string s, const std::string t
)
Run Code Online (Sandbox Code Playgroud)

应该是这样的:

void some_class::some_func(const std:string s,
                           const std::string t)
Run Code Online (Sandbox Code Playgroud)

或这个:

void some_class::some_func(const std:string s
                           , const std::string t)
Run Code Online (Sandbox Code Playgroud)

编辑:

我的.clang格式:

#http://clang.llvm.org/docs/ClangFormatStyleOptions.html

# The style used for all options not specifically …
Run Code Online (Sandbox Code Playgroud)

clang-format

12
推荐指数
1
解决办法
5598
查看次数

标签 统计

clang-format ×1