clang-format
Auto-format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code. More information: https://clang.llvm.org/docs/ClangFormat.html.
- Format a file and print the result to
stdout:
clang-format
- Format a file in-place:
clang-format -i
- Format a file using a predefined coding style:
clang-format --style
- Format a file using the
.clang-formatfile in one of the parent directories of the source file:
clang-format --style file
- Generate a custom
.clang-formatfile:
clang-format --style --dump-config >
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
