clang-format

clang-format: always break if params don't fit?

好久不见. 提交于 2020-08-22 07:20:49
问题 I can't figure out if it's possible to configure clang-format to always break if parameters don't fit, ie: // Try this first: SomeCall(aaa, bbb, ccc); // If doesn't fit, try this: SomeCall( aaa, bbb, ccc); // If still doesn't fit, do NOT try this: SomeCall(aaa, bbb, ccc); // and NOT this: SomeCall(aaa, bbb, ccc); // but immediately do this: SomeCall( aaa, bbb, ccc); So far I've concluded that it's not possible to do this with clang-format 3.4. Is it correct? 回答1: In newer version of clang

clang-format: always break if params don't fit?

荒凉一梦 提交于 2020-08-22 07:20:42
问题 I can't figure out if it's possible to configure clang-format to always break if parameters don't fit, ie: // Try this first: SomeCall(aaa, bbb, ccc); // If doesn't fit, try this: SomeCall( aaa, bbb, ccc); // If still doesn't fit, do NOT try this: SomeCall(aaa, bbb, ccc); // and NOT this: SomeCall(aaa, bbb, ccc); // but immediately do this: SomeCall( aaa, bbb, ccc); So far I've concluded that it's not possible to do this with clang-format 3.4. Is it correct? 回答1: In newer version of clang

How do I specify a clang-format file?

流过昼夜 提交于 2020-08-22 07:13:53
问题 I just built clang 5.0.0 on a Redhat 6 machine and tried to run clang-format. I'm unable to get the -style option to read in a style file. Here's an example of a set of commands that I think should work: ./clang-format -style=llvm -dump-config > .llvm-format ./clang-format -style=.llvm-format ~/myFile.cc When I run this command I get the following error: Invalid value for -style It appears to find and use .clang-format when placed in a parent directory as expect. The built-in types also work:

How do I specify a clang-format file?

有些话、适合烂在心里 提交于 2020-08-22 07:13:29
问题 I just built clang 5.0.0 on a Redhat 6 machine and tried to run clang-format. I'm unable to get the -style option to read in a style file. Here's an example of a set of commands that I think should work: ./clang-format -style=llvm -dump-config > .llvm-format ./clang-format -style=.llvm-format ~/myFile.cc When I run this command I get the following error: Invalid value for -style It appears to find and use .clang-format when placed in a parent directory as expect. The built-in types also work: