Skip to content

Commit 468bb63

Browse files
committed
sort includes with clang format
1 parent 8f86eb9 commit 468bb63

112 files changed

Lines changed: 365 additions & 221 deletions

File tree

Some content is hidden

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

‎.clang-format‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,22 @@ SpaceAfterControlStatementKeyword: true
4444
SpaceBeforeAssignmentOperators: true
4545
SpaceBeforeParens: Never
4646
ContinuationIndentWidth: 4
47-
SortIncludes: false
47+
SortIncludes: CaseSensitive
48+
IncludeBlocks: Regroup
49+
IncludeCategories:
50+
# Main header (same name as source file)
51+
- Regex: '^"[^/]*\.h(pp)?"$'
52+
Priority: 1
53+
# BehaviorTree.CPP project headers
54+
- Regex: '^"behaviortree_cpp/.*'
55+
Priority: 2
56+
# C++ standard library headers
57+
- Regex: '^<[a-z_]+>$'
58+
Priority: 3
59+
# System headers with .h extension
60+
- Regex: '^<.*\.h>'
61+
Priority: 4
62+
IncludeIsMainRegex: '(_test)?$'
4863
SpaceAfterCStyleCast: false
4964
ReflowComments: false
5065

‎.pre-commit-config.yaml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,15 @@ repos:
6161
- tomli
6262
args:
6363
[--toml=./pyproject.toml]
64+
65+
# Include What You Use (requires: apt install iwyu, and compile_commands.json)
66+
- repo: local
67+
hooks:
68+
- id: iwyu
69+
name: include-what-you-use
70+
entry: iwyu_tool -p build
71+
language: system
72+
files: \.(cpp|hpp|h)$
73+
exclude: ^3rdparty/|^include/behaviortree_cpp/contrib/
74+
pass_filenames: false
75+
stages: [manual]

‎examples/ex03_ncurses_manual_selector.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#include "behaviortree_cpp/bt_factory.h"
21
#include "dummy_nodes.h"
32

3+
#include "behaviortree_cpp/bt_factory.h"
4+
45
using namespace BT;
56

67
/* Try also

‎examples/ex03_sqlite_log.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "dummy_nodes.h"
2+
23
#include "behaviortree_cpp/bt_factory.h"
34
#include "behaviortree_cpp/loggers/bt_sqlite_logger.h"
45
#include "behaviortree_cpp/xml_parsing.h"

‎examples/plugin_example/plugin_action.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "custom_type.hpp"
2+
23
#include "behaviortree_cpp/bt_factory.h"
34

45
class PrintVector : public BT::SyncActionNode

‎examples/t02_basic_ports.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include "behaviortree_cpp/bt_factory.h"
2-
31
#include "dummy_nodes.h"
42

3+
#include "behaviortree_cpp/bt_factory.h"
4+
55
using namespace BT;
66

77
/** This tutorial will teach you how basic input/output ports work.

‎examples/t04_reactive_sequence.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include "behaviortree_cpp/bt_factory.h"
2-
31
#include "dummy_nodes.h"
42
#include "movebase_node.h"
53

4+
#include "behaviortree_cpp/bt_factory.h"
5+
66
using namespace BT;
77

88
/** This tutorial will teach you:

‎examples/t05_crossdoor.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "crossdoor_nodes.h"
2+
23
#include "behaviortree_cpp/bt_factory.h"
34

45
/** This is a more complex example that uses Fallback,

‎examples/t06_subtree_port_remapping.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include "behaviortree_cpp/loggers/bt_cout_logger.h"
2-
#include "behaviortree_cpp/bt_factory.h"
3-
4-
#include "movebase_node.h"
51
#include "dummy_nodes.h"
2+
#include "movebase_node.h"
3+
4+
#include "behaviortree_cpp/bt_factory.h"
5+
#include "behaviortree_cpp/loggers/bt_cout_logger.h"
66

77
/** In the CrossDoor example we did not exchange any information
88
* between the Maintree and the DoorClosed subtree.

‎examples/t07_load_multiple_xml.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "dummy_nodes.h"
2+
23
#include "behaviortree_cpp/bt_factory.h"
34

45
/** This example show how it is possible to:

0 commit comments

Comments
 (0)