Top "Clang-format" questions

clang-format is a tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.

Can you set clang-format's line length?

clang-format is breaking up my lines at 80 columns. Is there a way to make stop breaking lines? The documentation doesn't …

clang-format
How to mark a region so clang-format won't touch it?

For example, in the MySQL++ library there are macros that can be used to define simple structs based on sql …

c++ clang-format
clang-format: force arguments and parameters to one-line-each if the statement overflows

Is there a way to force arguments and parameters to one-line-each if a single or more character go past the …

clang-format
How to auto indent a C++ class with 4 spaces using clang-format?

I got the next .clang-format file in my project's root directory: --- AlignTrailingComments: true AllowShortFunctionsOnASingleLine: false AllowShortIfStatementsOnASingleLine: true AllowShortLoopsOnASingleLine: true …

c++ indentation auto-indent clang-format
Can clang-format break my code?

As clang-format is a tool to only reformat code, is it possible that such formatting can break working code or …

c clang-format
Can clang format add braces to single line if statements etc

Is there an option for clang-format to add braces to all if()/do/while statements etc? eg if( i == 42 ) std::…

c++ clang clang-format
In clang-format, what do the penalties do?

The clang-format sytle options documentation includes a number of options called PenaltyXXX. The documentation doesn't explain how these penalties should …

c++ clang-format
Prepare vim environment to work with clang-format

Problem: E319: Sorry, the command is not available in this version Problem When I run vim environment and try reformat …

c++ macos vim clang clang-format
Run git-clang-format on series of git commits

I have written a series of git commits, with awful code formatting. Before I push them to github, I want …

git formatting clang clang-format
Can clang-format align variable or macro assignments in columns?

Is it possible to have clang-format align variable assignments in columns? For example: int someInteger = 42; std::string someString = "string"; const …

c++ c c++11 clang clang-format