From b8a1ccc2005cae5b16f4c757f36f753c8df28f36 Mon Sep 17 00:00:00 2001 From: Markus Pielmeier Date: Sat, 24 Oct 2020 14:40:29 +0200 Subject: [PATCH] clang-format: add page (#4736) --- pages/common/clang-format.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/common/clang-format.md diff --git a/pages/common/clang-format.md b/pages/common/clang-format.md new file mode 100644 index 0000000000..dc1510b6d6 --- /dev/null +++ b/pages/common/clang-format.md @@ -0,0 +1,24 @@ +# clang-format + +> Tool to auto-format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code. +> More information: . + +- Format a file and print the result to `stdout`: + +`clang-format {{path/to/file}}` + +- Format a file in-place: + +`clang-format -i {{path/to/file}}` + +- Format a file using a predefined coding style: + +`clang-format --style={{LLVM|Google|Chromium|Mozilla|WebKit}} {{path/to/file}}` + +- Format a file using the `.clang-format` file in one of the parent directories of the source file: + +`clang-format --style=file {{path/to/file}}` + +- Generate a custom `.clang-format` file: + +`clang-format --style={{LLVM|Google|Chromium|Mozilla|WebKit}} --dump-config > {{.clang-format}}`