【发布时间】:2015-02-01 09:11:01
【问题描述】:
有没有可以UN-split行的程序(比如Astyle)?
例子:
// These
void foo(
int one,
int two,
double three);
double a = b *
c;
// Becomes this
void foo(int one, int two, double three);
double a = b * c;
【问题讨论】:
-
你看过 clang-format, uncrustify 吗?
-
体面的 IDE 也可以这样做,例如 Eclipse 有格式选项。
-
@Jarod42 只是看了一下 clang-format 文档,没有看到任何东西。 Uncrustify 看起来很难弄清楚......
-
我使用集成了 AStyle/clang-format 的 Codelite,它可以满足您的需求(使用 clang-format)。懒得去搜索命令行对应的选项了。
-
@Jarod42 如果你这样做了,你可以写一个答案让我接受;)
标签: c++ formatting code-formatting