Skip to content
Snippets Groups Projects
Commit be6615c2 authored by Philipp Spilger's avatar Philipp Spilger
Browse files

Change include order for C/C++ in clang-format config

* orders non-system headers first and system headers below.
* this allows early fail for non-existant system header dependencies
  in included non-system headers

Change-Id: Ieaba7dd85232f5a2fc4d8244c0938a318406dae4
parent 5c6f4305
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,10 @@ UseTab: ForIndentation ...@@ -30,6 +30,10 @@ UseTab: ForIndentation
# of lines within a group. # of lines within a group.
# 0. #include "something.h" # 0. #include "something.h"
# | main header for a source file # | main header for a source file
# 0. #include "halbe/hal/Coordinate.h"
# #include "sthal/HICANN.h"
# #include "marocco/placement/NeuronPlacement.h"
# | Includes from our projects (i.e. not system path) should come first
# 1. #include <algorithm> # 1. #include <algorithm>
# #include <vector> # #include <vector>
# etc. # etc.
...@@ -42,25 +46,16 @@ UseTab: ForIndentation ...@@ -42,25 +46,16 @@ UseTab: ForIndentation
# 3. #include <yaml-cpp/yaml.h> # 3. #include <yaml-cpp/yaml.h>
# etc. # etc.
# | other libraries searched via system include path. # | other libraries searched via system include path.
# 3. #include "halbe/hal/Coordinate.h"
# #include "sthal/HICANN.h"
# etc.
# | Includes from other projects should come before includes from
# | the current project.
# 4. #include "marocco/placement/NeuronPlacement.h"
# etc.
IncludeCategories: IncludeCategories:
# standard library # standard library
- Regex: '^<[^/]+>$' - Regex: '^<[^/]+>$'
Priority: 1
- Regex: '^<boost/'
Priority: 2 Priority: 2
- Regex: '^<boost/'
Priority: 3
# other system headers # other system headers
- Regex: '^<' - Regex: '^<'
Priority: 3 Priority: 4
# Group marocco headers after other local includes. # Group marocco headers after other local includes.
- Regex: '^"(py)?marocco/'
Priority: 5
- Regex: '.*' - Regex: '.*'
Priority: 4 Priority: 1
... ...
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