Skip to content

Commit 9057962

Browse files
committed
fix: add explicit ordering to includes
1 parent d3746a9 commit 9057962

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+105
-53
lines changed

.clang-format

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,27 @@ BinPackParameters: false
99
BreakBeforeBinaryOperators: All
1010
BreakConstructorInitializers: BeforeColon
1111
ColumnLimit: 99
12+
IncludeBlocks: Regroup
1213
IndentCaseLabels: true
1314
IndentPPDirectives: AfterHash
1415
IndentWidth: 4
1516
Language: Cpp
1617
SpaceAfterCStyleCast: true
1718
Standard: Cpp11
1819
TabWidth: 4
20+
IncludeCategories:
21+
- Regex: '<pybind11/.*'
22+
Priority: -1
23+
- Regex: 'pybind11.h"$'
24+
Priority: 1
25+
- Regex: '^".*/?detail/'
26+
Priority: 1
27+
SortPriority: 2
28+
- Regex: '^"'
29+
Priority: 1
30+
SortPriority: 3
31+
- Regex: '<[[:alnum:]._]+>'
32+
Priority: 4
33+
- Regex: '.*'
34+
Priority: 5
1935
...

include/pybind11/cast.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "detail/type_caster_base.h"
1616
#include "detail/typeid.h"
1717
#include "pytypes.h"
18+
1819
#include <array>
1920
#include <cstring>
2021
#include <functional>

include/pybind11/chrono.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
#include <chrono>
1616
#include <cmath>
1717
#include <ctime>
18-
#include <mutex>
19-
2018
#include <datetime.h>
19+
#include <mutex>
2120

2221
// Backport the PyDateTime_DELTA functions from Python3.3 if required
2322
#ifndef PyDateTime_DELTA_GET_DAYS

include/pybind11/complex.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#pragma once
1111

1212
#include "pybind11.h"
13+
1314
#include <complex>
1415

1516
/// glibc defines I as a macro which breaks things, e.g., boost template names

include/pybind11/detail/internals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#pragma once
1111

1212
#include "../pytypes.h"
13+
1314
#include <exception>
1415

1516
/// Tracks the `internals` and `type_info` ABI version independent of the main library version.

include/pybind11/detail/type_caster_base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "descr.h"
1515
#include "internals.h"
1616
#include "typeid.h"
17+
1718
#include <cstdint>
1819
#include <iterator>
1920
#include <new>

include/pybind11/embed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
#pragma once
1111

12-
#include "eval.h"
1312
#include "pybind11.h"
13+
#include "eval.h"
1414

1515
#include <memory>
1616
#include <vector>

include/pybind11/eval.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
#pragma once
1313

14-
#include <utility>
15-
1614
#include "pybind11.h"
1715

16+
#include <utility>
17+
1818
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1919
PYBIND11_NAMESPACE_BEGIN(detail)
2020

include/pybind11/functional.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#pragma once
1111

1212
#include "pybind11.h"
13+
1314
#include <functional>
1415

1516
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

include/pybind11/numpy.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
#pragma once
1111

12-
#include "complex.h"
1312
#include "pybind11.h"
13+
#include "complex.h"
14+
1415
#include <algorithm>
1516
#include <array>
1617
#include <cstdint>

0 commit comments

Comments
 (0)