Issue 142225
Summary [clang-format] Main headers are ignored if priority is negative
Labels clang-format
Assignees
Reporter EugeneZelenko
    My work project coding style convention requires main header file to be last one. It means that all other headers must have negative priorities. But `IncludeCategoryManager::getIncludePriority` and `IncludeCategoryManager::getSortIncludePriority`  ignore such headers.

I tried 19.1.1 and `main` (49d48c32e04742ebd05cbbd7dd544b1217b6d9d0)

Configuration:

```
IncludeCategories:
 # C-Python header
  - Regex:           '^<Python\.h>$'
    Priority: -6
    CaseSensitive:   true
  # System headers
  - Regex: '^<.+\.h>$'
    Priority:        -5
    CaseSensitive:   true
  # STL headers
  - Regex:           '^<[a-z][a-z_]+>$'
    Priority:        -4
 CaseSensitive:   true
  # Boost headers
  - Regex: '^<boost/.+>$'
    Priority:        -3
    CaseSensitive:   true
  # Qt headers
  - Regex:           '^<Q.+>$'
    Priority:        -2
 CaseSensitive:   true
  # Local headers
  - Regex:           '^".+"$'
 Priority:        -1
    CaseSensitive:   true
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to