Skip to content

Commit 38da318

Browse files
ximineztequdev
authored andcommitted
refactor: Improve ordering of headers with clang-format (#5343)
Removes all manual header groupings from source and header files by leveraging clang-format options.
1 parent 744bc9d commit 38da318

File tree

709 files changed

+934
-66
lines changed

Some content is hidden

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

709 files changed

+934
-66
lines changed

.clang-format

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ DerivePointerAlignment: false
4444
DisableFormat: false
4545
ExperimentalAutoDetectBinPacking: false
4646
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
47+
IncludeBlocks: Regroup
4748
IncludeCategories:
4849
- Regex: '^<(test)/'
4950
Priority: 0
@@ -53,8 +54,12 @@ IncludeCategories:
5354
Priority: 2
5455
- Regex: '^<(boost)/'
5556
Priority: 3
56-
- Regex: '.*'
57+
- Regex: '^.*/'
5758
Priority: 4
59+
- Regex: '^.*\.h'
60+
Priority: 5
61+
- Regex: '.*'
62+
Priority: 6
5863
IncludeIsMainRegex: '$'
5964
IndentCaseLabels: true
6065
IndentFunctionDeclarationAfterType: false

examples/example/src/example.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include <cstdio>
2-
31
#include <xrpl/protocol/BuildInfo.h>
42

3+
#include <cstdio>
4+
55
int main(int argc, char const** argv) {
66
std::printf("%s\n", ripple::BuildInfo::getVersionString().c_str());
77
return 0;

hook/hookapi.h

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

4646
#include "error.h"
4747
#include "extern.h"
48-
#include "sfcodes.h"
4948
#include "macro.h"
49+
#include "sfcodes.h"
5050
#include "tts.h"
5151

5252
#endif

include/xrpl/basics/Log.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <boost/beast/core/string.hpp>
2727
#include <boost/filesystem.hpp>
28+
2829
#include <fstream>
2930
#include <map>
3031
#include <memory>

include/xrpl/beast/hash/xxhasher.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define BEAST_HASH_XXHASHER_H_INCLUDED
2222

2323
#include <boost/endian/conversion.hpp>
24+
2425
#include <xxhash.h>
2526

2627
#include <cstddef>

include/xrpl/hook/Guard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Enum.h"
2+
23
#include <functional>
34
#include <iostream>
45
#include <map>

include/xrpl/hook/guard_checker.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
#include <sys/ioctl.h>
2+
#include <sys/stat.h>
3+
14
#include "Guard.h"
25
#include <fcntl.h>
3-
#include <iostream>
4-
#include <optional>
5-
#include <ostream>
66
#include <stdint.h>
77
#include <stdio.h>
88
#include <string.h>
9-
#include <string_view>
10-
#include <sys/ioctl.h>
11-
#include <sys/stat.h>
129
#include <unistd.h>
10+
11+
#include <iostream>
12+
#include <optional>
13+
#include <ostream>
14+
#include <string_view>
1315
#include <vector>
1416

1517
int

include/xrpl/protocol/Import.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222

2323
// #include <ripple/basics/Log.h>
2424
#include <xrpld/app/misc/Manifest.h>
25+
2526
#include <xrpl/basics/StringUtilities.h>
2627
#include <xrpl/basics/base64.h>
2728
#include <xrpl/json/json_reader.h>
29+
2830
#include <charconv>
2931

3032
namespace ripple {

include/xrpl/protocol/STLedgerEntry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ STLedgerEntry::getType() const
124124

125125
} // namespace ripple
126126

127-
#endif
127+
#endif

include/xrpl/server/detail/UDPDoor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <xrpl/server/detail/PlainHTTPPeer.h>
2626
#include <xrpl/server/detail/SSLHTTPPeer.h>
2727
#include <xrpl/server/detail/io_list.h>
28+
2829
#include <boost/asio/basic_waitable_timer.hpp>
2930
#include <boost/asio/buffer.hpp>
3031
#include <boost/asio/io_context.hpp>
@@ -34,6 +35,7 @@
3435
#include <boost/beast/core/multi_buffer.hpp>
3536
#include <boost/beast/core/tcp_stream.hpp>
3637
#include <boost/container/flat_map.hpp>
38+
3739
#include <chrono>
3840
#include <condition_variable>
3941
#include <functional>

0 commit comments

Comments
 (0)