You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/10 08:58:55 UTC

[GitHub] [incubator-doris] adonis0147 opened a new issue, #9482: [style] Use clang-format to sort includes

adonis0147 opened a new issue, #9482:
URL: https://github.com/apache/incubator-doris/issues/9482

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Description
   
   Before the commit #9305 , if we use `clang-format` to format our codebase, the `clang-format` sorts the includes.
   
   #9305 claims that there are some compilation errors occurring after we sort the includes in our codebase. Generally speaking, it is right due to the conditional includes (some includes must be put after others, see [google code style](https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes)). However, the number of these exceptions is small, we can treat them case by case.
   
   There are some approaches to handle these exceptions:
   1. Exclude the whole file - Adding it to `.clang-format-ignore`
   2. Exclude some regions in the file - Please refer to [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code)
   
   All in all, it is very helpful if we can unify the order of includes. After investigation, the compilation errors was caused by `/be/src/service/brpc.h`. In `brpc.h`, the `service/brpc_conflict.h` must be included first.
   
   ### Solution
   
   1. Revert the setting of `.clang-format`
   2. Fix the compilation errors.
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-doris] yiguolei closed issue #9482: [style] Use clang-format to sort includes

Posted by GitBox <gi...@apache.org>.
yiguolei closed issue #9482: [style] Use clang-format to sort includes
URL: https://github.com/apache/incubator-doris/issues/9482


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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