clang-format is breaking up my lines at 80 columns. Is there a way to make stop breaking lines? The documentation doesn't seem to address this.
clang-format supports two ways to provide custom style options: directly specify style configuration in the -style= command line option or use -style=file and put style configuration in the . clang-format or _clang-format file in the project directory.
Short answer: YES. The clang-format tool has a -sort-includes option. Changing the order of #include directives can definitely change the behavior of existing code, and may break existing code.
clang-format is located in clang/tools/clang-format and can be used to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code.
The configuration option responsible for it is called ColumnLimit
. You can remove the column limit by setting it to 0.
ColumnLimit: 0
Find ColumnLimit
(under "Configurable Format Style Options" heading) on that page and you'll find the following statement:
ColumnLimit (unsigned)
The column limit.
A column limit of 0 means that there is no column limit. In this case, clang-format will respect the input’s line breaking decisions within statements unless they contradict other rules.
Source: Clang-Format Docs (v4.0.0, latest). Italics added for emphasis.
So, just like the docs say, set...
ColumnLimit: 0
... and you should be set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With