Commit 185fe49f authored by Marc Chevrier's avatar Marc Chevrier Committed by Brad King

clang-format: Normalize headers presentation

By using clang-format directives 'IncludeBlocks' and 'IncludeCategories'
headers are regrouped by categories:
1. "cmConfigure.h" which must be first
2. header matching current implementation file
3. standard language headers
4. CMake replacement ones
5. external  headers (i.e. #include directive with '<' and '>')
6. Qt headers
7. cmsys/* headers
8. cm_* headers
9. CMake headers (i.e. starting with 'cm[A-Z]')
10. all other headers

Fixes: #19674
parent 42ef28b4
......@@ -18,4 +18,28 @@ ColumnLimit: 79
IndentPPDirectives: AfterHash
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"]cmConfigure\.h'
Priority: -1
- Regex: '^(<|")cm/'
Priority: 2
- Regex: '^(<|")windows\.h'
Priority: 3
- Regex: '^<sys/'
Priority: 5
- Regex: '^(<|")Qt?[A-Z]'
Priority: 6
- Regex: '^(<|")cmsys/'
Priority: 7
- Regex: '^(<|")cm_'
Priority: 8
- Regex: '^(<|")cm[A-Z][^.]+\.h'
Priority: 9
- Regex: '^<[^.]+\.h'
Priority: 4
- Regex: '^<'
Priority: 1
- Regex: '.*'
Priority: 10
...
#include <assert.h>
// clang-format off
#include <stdio.h>
#include <jpeglib.h>
// clang-format on
int main()
{
......
......@@ -167,12 +167,12 @@ static Bool test_Xkb(void)
#endif
#ifdef HAVE_X11_xkbfile
// clang-format off
# include <stdio.h>
# include <X11/XKBlib.h>
# include <X11/extensions/XKBfile.h>
# include <stdlib.h>
// clang-format on
static void test_xkbfile(void)
{
......@@ -184,7 +184,6 @@ static void test_xkbfile(void)
#ifdef HAVE_X11_Xmu
# include <X11/Xmu/Xmu.h>
# include <stdlib.h>
static Bool test_Xmu(void)
......
// ChildFrm.cpp : implementation of the CChildFrame class
//
// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "ChildFrm.h"
// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
......
// MainFrm.cpp : implementation of the CMainFrame class
//
// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "MainFrm.h"
// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
......
// mfc1.cpp : Defines the class behaviors for the application.
//
// clang-format off
#include "stdafx.h"
#include "MainFrm.h"
......@@ -9,6 +10,7 @@
#include "ChildFrm.h"
#include "mfc1Doc.h"
#include "mfc1View.h"
// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
......
// mfc1Doc.cpp : implementation of the Cmfc1Doc class
//
// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "mfc1Doc.h"
// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
......
// mfc1View.cpp : implementation of the Cmfc1View class
//
// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "mfc1Doc.h"
#include "mfc1View.h"
// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
......
// clang-format off
#include "pch.h"
#include "CubeRenderer.h"
// clang-format on
using namespace DirectX;
using namespace Microsoft::WRL;
......
#pragma once
// clang-format off
#include "pch.h"
#include "CubeRenderer.h"
// clang-format on
ref class Direct3DApp1 sealed
: public Windows::ApplicationModel::Core::IFrameworkView
......
// clang-format off
#include "pch.h"
#include "Direct3DBase.h"
// clang-format on
using namespace DirectX;
using namespace Microsoft::WRL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment