Я использую формат .clang в своем проекте для настройки своего стиля кодирования. Среди них я настроил параметры сортировки заголовочных файлов с помощью IncludeCategories. Конкретные правила конфигурации следующие:
Код: Выделить всё
IncludeCategories:
- Regex: '^"(?!3rd|vendor).*\.(h|hpp)"$'
Priority: 1
# This category matches project headers, such as "module.h"
- Regex: '^"(3rd|vendor).*\.(h|hpp)"$'
Priority: 2
# This category matches third-party headers, such as "3rd/module.h" or "vendor/module.hpp"
- Regex: '^'
Priority: 3
# This category matches system headers, such as
- Regex: '^]+>$'
Priority: 4
# This category matches standard library, such as
Мне нужен эффект:
Код: Выделить всё
#include "sub/sub.h"
#include "work.h"
#include "3rd/util.h"
#include
#include
Код: Выделить всё
#include "3rd/util.h"
#include
#include
#include "sub/sub.h"
#include "work.h"
Источник: https://stackoverflow.com/questions/781 ... categories
Мобильная версия