This project uses angle brackets instead of quotes for project-specific headers. Setting MainIncludeChar enables clang-format to automatically detect the main header, so it can be kept as the top group of includes.
For example, without this change, clang-format would demote <signet.h> from being the main header in src/signet.cpp. With this change, the order is preserved.
On 5e49f5d63c74512c8f46fe7de7deb0341f13244a:
0% clang-format src/signet.cpp | head -n 15
1// Copyright (c) 2019-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <consensus/merkle.h>
6#include <consensus/params.h>
7#include <consensus/validation.h>
8#include <logging.h>
9#include <primitives/block.h>
10#include <primitives/transaction.h>
11#include <script/interpreter.h>
12#include <script/script.h>
13#include <signet.h>
14#include <streams.h>
15#include <uint256.h>
With this PR:
0% clang-format src/signet.cpp | head -n 10
1// Copyright (c) 2019-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <signet.h>
6
7#include <consensus/merkle.h>
8#include <consensus/params.h>
9#include <consensus/validation.h>
10#include <logging.h>
Note: AngleBracket requires clang-format 19, and will cause older versions (including our current minimum llvm version 17) to fail