clang-format Command Examples

Auto-format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code. More information: https://clang.llvm.org/docs/ClangFormat.html.

clang-format {{path/to/file}}

clang-format -i {{path/to/file}}

clang-format --style {{LLVM|GNU|Google|Chromium|Microsoft|Mozilla|WebKit}} {{path/to/file}}

clang-format --style=file {{path/to/file}}

clang-format --style {{LLVM|GNU|Google|Chromium|Microsoft|Mozilla|WebKit}} --dump-config > {{.clang-format}}