refactor: Remove unused and add missing includes (#5293)

The codebase is filled with includes that are unused, and which thus can be removed. At the same time, the files often do not include all headers that contain the definitions used in those files. This change uses clang-format and clang-tidy to clean up the includes, with minor manual intervention to ensure the code compiles on all platforms.
This commit is contained in:
Bart
2025-03-11 14:16:45 -04:00
committed by GitHub
parent 2216e5a13f
commit 2406b28e64
767 changed files with 1465 additions and 1083 deletions

View File

@@ -20,6 +20,7 @@
#include <test/csf/BasicNetwork.h>
#include <test/csf/Scheduler.h>
#include <xrpl/beast/unit_test.h>
#include <set>
#include <vector>

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_COLLECTOREF_H_INCLUDED
#define RIPPLE_TEST_CSF_COLLECTOREF_H_INCLUDED

View File

@@ -19,6 +19,7 @@
#include <test/csf/Digraph.h>
#include <xrpl/beast/unit_test.h>
#include <string>
#include <vector>

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_HISTOGRAM_H_INCLUDED
#define RIPPLE_TEST_CSF_HISTOGRAM_H_INCLUDED

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_PEER_H_INCLUDED
#define RIPPLE_TEST_CSF_PEER_H_INCLUDED
@@ -30,8 +31,10 @@
#include <xrpld/consensus/Validations.h>
#include <xrpl/beast/utility/WrappedSink.h>
#include <xrpl/protocol/PublicKey.h>
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include <algorithm>
namespace ripple {

View File

@@ -16,11 +16,13 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_PEERGROUP_H_INCLUDED
#define RIPPLE_TEST_CSF_PEERGROUP_H_INCLUDED
#include <test/csf/Peer.h>
#include <test/csf/random.h>
#include <algorithm>
#include <vector>

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_PROPOSAL_H_INCLUDED
#define RIPPLE_TEST_CSF_PROPOSAL_H_INCLUDED

View File

@@ -18,7 +18,6 @@
//==============================================================================
#include <test/csf/Scheduler.h>
#include <xrpl/basics/ByteUtilities.h>
#include <xrpl/beast/unit_test.h>
#include <set>

View File

@@ -21,6 +21,7 @@
#define RIPPLE_TEST_CSF_SIMTIME_H_INCLUDED
#include <xrpl/beast/clock/manual_clock.h>
#include <chrono>
namespace ripple {

View File

@@ -21,6 +21,7 @@
#define RIPPLE_TEST_CSF_UNL_H_INCLUDED
#include <test/csf/random.h>
#include <boost/container/flat_set.hpp>
#include <chrono>

View File

@@ -16,12 +16,16 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_TX_H_INCLUDED
#define RIPPLE_TEST_CSF_TX_H_INCLUDED
#include <xrpl/beast/hash/hash_append.h>
#include <xrpl/beast/hash/uhash.h>
#include <boost/container/flat_set.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <algorithm>
#include <map>
#include <ostream>

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_VALIDATION_H_INCLUDED
#define RIPPLE_TEST_CSF_VALIDATION_H_INCLUDED

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_COLLECTORS_H_INCLUDED
#define RIPPLE_TEST_CSF_COLLECTORS_H_INCLUDED

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_EVENTS_H_INCLUDED
#define RIPPLE_TEST_CSF_EVENTS_H_INCLUDED
@@ -23,6 +24,7 @@
#include <test/csf/Tx.h>
#include <test/csf/Validation.h>
#include <test/csf/ledgers.h>
#include <chrono>
namespace ripple {

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <test/csf/Sim.h>
namespace ripple {

View File

@@ -16,10 +16,10 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <test/csf/ledgers.h>
#include <algorithm>
#include <sstream>
#include <test/csf/ledgers.h>
#include <algorithm>
namespace ripple {
namespace test {

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_LEDGERS_H_INCLUDED
#define RIPPLE_TEST_CSF_LEDGERS_H_INCLUDED
@@ -26,7 +27,9 @@
#include <xrpl/basics/comparators.h>
#include <xrpl/basics/tagged_integer.h>
#include <xrpl/json/json_value.h>
#include <boost/bimap/bimap.hpp>
#include <optional>
#include <set>

View File

@@ -16,6 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_SUBMITTERS_H_INCLUDED
#define RIPPLE_TEST_CSF_SUBMITTERS_H_INCLUDED
@@ -23,7 +24,9 @@
#include <test/csf/Scheduler.h>
#include <test/csf/SimTime.h>
#include <test/csf/Tx.h>
#include <type_traits>
namespace ripple {
namespace test {
namespace csf {

View File

@@ -16,11 +16,13 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_TEST_CSF_TIMERS_H_INCLUDED
#define RIPPLE_TEST_CSF_TIMERS_H_INCLUDED
#include <test/csf/Scheduler.h>
#include <test/csf/SimTime.h>
#include <chrono>
#include <ostream>