vagetablechicken opened a new issue #2272: Formatting C++ Code With 
clang-format?
URL: https://github.com/apache/incubator-doris/issues/2272
 
 
   Let's clang-format~
   
   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.
   
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configuring-style-with-clang-format
   
   Generally, we use -style=file, and customize .clang-format.
   
   Doris style seems more like Google style. So we can dump the Google style, 
then modify it.
   `clang-format -style=google -dump-config > .clang-format `
   
   Available style options are described in [Clang-Format Style 
Options](https://clang.llvm.org/docs/ClangFormat.html). Be careful of the 
versions. The most recent version is clang-format-10 which supports more 
options, but clang-format-3.8/3.9 is more widely used. 
   
   [Clang-Format-3.8 Style 
Options](https://releases.llvm.org/3.8.0/tools/clang/docs/ClangFormatStyleOptions.html)
 is recommended.
   
   Here is my .clang-format, just very little modification.
   https://gist.github.com/vagetablechicken/f3c70fad8d9fab2b0be2005d4bd371f4

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to