clang-format
ツールが改行を削除しないようにする設定を探しています。
たとえば、私はColumnLimit
120 に設定しており、サンプル コードを再フォーマットすると次のようになります。
前:
#include <vector>
#include <string>
std::vector<std::string> get_vec()
{
return std::vector<std::string> {
"this is a test",
"some of the lines are longer",
"than other, but I would like",
"to keep them on separate lines"
};
}
int main()
{
auto vec = get_vec();
}
後:
#include <vector>
#include <string>
std::vector<std::string> get_vec()
{
return std::vector<std::string>{"this is a test", "some of the lines are longer", "than other, but I would like",
"to keep them on separate lines"};
}
int main()
{
auto vec = get_vec();
}
私が望むのは、ツールが 120 文字を超える行を分割することですが、120 文字未満であるという理由だけで行を結合することを決定しないことです。
そのようなオプションはありますか?ドキュメントには何も目立ちませんでした。