Skip to content

Commit 398fd29

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 398fd29

File tree

664 files changed

+846
-50
lines changed

Some content is hidden

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

664 files changed

+846
-50
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/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/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

src/libxrpl/basics/Archive.cpp

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

2626
#include <archive.h>
2727
#include <archive_entry.h>
28+
2829
#include <cstddef>
2930
#include <memory>
3031
#include <stdexcept>

src/libxrpl/basics/make_SSLContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <boost/asio/ssl/verify_mode.hpp>
2525
#include <boost/system/detail/error_code.hpp>
2626
#include <boost/system/detail/generic_category.hpp>
27+
2728
#include <openssl/asn1.h>
2829
#include <openssl/bn.h>
2930
#include <openssl/evp.h>

src/libxrpl/beast/utility/beast_EnhancedLogging.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
#ifdef BEAST_ENHANCED_LOGGING
2121

2222
#include <xrpl/beast/utility/EnhancedLogging.h>
23+
24+
#include <unistd.h>
25+
2326
#include <cstdlib>
2427
#include <cstring>
2528
#include <ostream>
26-
#include <unistd.h>
2729

2830
namespace beast {
2931
namespace detail {

src/libxrpl/protocol/PublicKey.cpp

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

3131
#include <boost/multiprecision/fwd.hpp>
3232
#include <boost/multiprecision/number.hpp>
33+
3334
#include <ed25519.h>
3435
#include <secp256k1.h>
3536

src/libxrpl/protocol/SecretKey.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <xrpl/protocol/tokens.h>
3535

3636
#include <boost/utility/string_view.hpp>
37+
3738
#include <ed25519.h>
3839
#include <secp256k1.h>
3940

0 commit comments

Comments
 (0)