unit-e icon indicating copy to clipboard operation
unit-e copied to clipboard

Add lint to check that includes a grouped correctly

Open kostyantyn opened this issue 6 years ago • 0 comments

Is your feature request related to a problem? Please describe We have a strict rule of how the include directives should be grouped and ordered in the *.cpp file however we don't have a check that validates this. Fortunately, the order of includes is taken care of by clang-format, and we have a lint that checks it. However, we don't have an automated tool to split includes by groups (currently not possible by clang-format as it allows to use only a simple regexp for that), but we can introduce a lint that checks that. It will speed up the development process and reduce nit discussions in PRs.

Describe the solution you'd like Would be great to detect that include directive are properly split by the following groups at the lint stage:

1. header of the translation unit
2. blank line
3. c/c++ headers
4. blank line
5. all other headers

Additional context Names_and_Order_of_Includes

kostyantyn avatar Jan 29 '19 09:01 kostyantyn