clang-format: Sort doctest header at the bottom

This commit is contained in:
Arne Welzel 2024-11-15 16:16:12 +01:00
parent a02ae82778
commit 0f1c1cb754
17 changed files with 36 additions and 18 deletions

View file

@ -71,6 +71,7 @@ IncludeBlocks: Regroup
# 4: any header that starts with "zeek/" # 4: any header that starts with "zeek/"
# 5: everything else, which should catch any of the auto-generated code from the # 5: everything else, which should catch any of the auto-generated code from the
# build directory as well # build directory as well
# 6: third party doctest header
# #
# Sections 0-1 and 2-3 get grouped together in their respective blocks # Sections 0-1 and 2-3 get grouped together in their respective blocks
IncludeCategories: IncludeCategories:
@ -86,6 +87,8 @@ IncludeCategories:
- Regex: '^<[[:print:]]+>' - Regex: '^<[[:print:]]+>'
Priority: 2 Priority: 2
SortPriority: 3 SortPriority: 3
- Regex: '^"zeek/3rdparty/doctest.h'
Priority: 6
- Regex: '^"zeek/' - Regex: '^"zeek/'
Priority: 4 Priority: 4
- Regex: '.*' - Regex: '.*'

View file

@ -2,10 +2,11 @@
#include <ares_nameser.h> #include <ares_nameser.h>
#include "zeek/3rdparty/doctest.h"
#include "zeek/DNS_Mgr.h" #include "zeek/DNS_Mgr.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/3rdparty/doctest.h"
namespace zeek::detail { namespace zeek::detail {
DNS_Mapping::DNS_Mapping(std::string host, struct hostent* h, uint32_t ttl, int type) { DNS_Mapping::DNS_Mapping(std::string host, struct hostent* h, uint32_t ttl, int type) {

View file

@ -32,7 +32,6 @@ using ztd::out_ptr::out_ptr;
#include <ares_dns.h> #include <ares_dns.h>
#include <ares_nameser.h> #include <ares_nameser.h>
#include "zeek/3rdparty/doctest.h"
#include "zeek/DNS_Mapping.h" #include "zeek/DNS_Mapping.h"
#include "zeek/Event.h" #include "zeek/Event.h"
#include "zeek/Expr.h" #include "zeek/Expr.h"
@ -47,6 +46,8 @@ using ztd::out_ptr::out_ptr;
#include "zeek/iosource/Manager.h" #include "zeek/iosource/Manager.h"
#include "zeek/telemetry/Manager.h" #include "zeek/telemetry/Manager.h"
#include "zeek/3rdparty/doctest.h"
// Number of seconds we'll wait for a reply. // Number of seconds we'll wait for a reply.
constexpr int DNS_TIMEOUT = 5; constexpr int DNS_TIMEOUT = 5;

View file

@ -2,9 +2,10 @@
#include "zeek/Dict.h" #include "zeek/Dict.h"
#include "zeek/3rdparty/doctest.h"
#include "zeek/Hash.h" #include "zeek/Hash.h"
#include "zeek/3rdparty/doctest.h"
namespace zeek { namespace zeek {
// namespace detail // namespace detail

View file

@ -8,7 +8,6 @@
#include <highwayhash/instruction_sets.h> #include <highwayhash/instruction_sets.h>
#include <highwayhash/sip_hash.h> #include <highwayhash/sip_hash.h>
#include "zeek/3rdparty/doctest.h"
#include "zeek/DebugLogger.h" #include "zeek/DebugLogger.h"
#include "zeek/Desc.h" #include "zeek/Desc.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
@ -18,6 +17,8 @@
#include "const.bif.netvar_h" #include "const.bif.netvar_h"
#include "zeek/3rdparty/doctest.h"
namespace zeek::detail { namespace zeek::detail {
alignas(32) uint64_t KeyedHash::shared_highwayhash_key[4]; alignas(32) uint64_t KeyedHash::shared_highwayhash_key[4];

View file

@ -7,13 +7,14 @@
#include <cstdlib> #include <cstdlib>
#include <utility> #include <utility>
#include "zeek/3rdparty/doctest.h"
#include "zeek/CCL.h" #include "zeek/CCL.h"
#include "zeek/DFA.h" #include "zeek/DFA.h"
#include "zeek/EquivClass.h" #include "zeek/EquivClass.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/ZeekString.h" #include "zeek/ZeekString.h"
#include "zeek/3rdparty/doctest.h"
zeek::detail::CCL* zeek::detail::curr_ccl = nullptr; zeek::detail::CCL* zeek::detail::curr_ccl = nullptr;
zeek::detail::Specific_RE_Matcher* zeek::detail::rem = nullptr; zeek::detail::Specific_RE_Matcher* zeek::detail::rem = nullptr;
zeek::detail::NFA_Machine* zeek::detail::nfa = nullptr; zeek::detail::NFA_Machine* zeek::detail::nfa = nullptr;

View file

@ -9,7 +9,6 @@
#include <syslog.h> #include <syslog.h>
#include <unistd.h> #include <unistd.h>
#include "zeek/3rdparty/doctest.h"
#include "zeek/Conn.h" #include "zeek/Conn.h"
#include "zeek/Desc.h" #include "zeek/Desc.h"
#include "zeek/Event.h" #include "zeek/Event.h"
@ -24,6 +23,8 @@
#include "zeek/plugin/Manager.h" #include "zeek/plugin/Manager.h"
#include "zeek/plugin/Plugin.h" #include "zeek/plugin/Plugin.h"
#include "zeek/3rdparty/doctest.h"
#ifdef SYSLOG_INT #ifdef SYSLOG_INT
extern "C" { extern "C" {
int openlog(const char* ident, int logopt, int facility); int openlog(const char* ident, int logopt, int facility);

View file

@ -9,12 +9,13 @@
#include <iostream> #include <iostream>
#include <sstream> // Needed for unit testing #include <sstream> // Needed for unit testing
#include "zeek/3rdparty/doctest.h"
#include "zeek/ID.h" #include "zeek/ID.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/Val.h" #include "zeek/Val.h"
#include "zeek/util.h" #include "zeek/util.h"
#include "zeek/3rdparty/doctest.h"
#ifdef DEBUG #ifdef DEBUG
#define DEBUG_STR(msg) DBG_LOG(zeek::DBG_STRING, msg) #define DEBUG_STR(msg) DBG_LOG(zeek::DBG_STRING, msg)
#else #else

View file

@ -5,12 +5,13 @@
#include <binpac.h> #include <binpac.h>
#include <algorithm> #include <algorithm>
#include "zeek/3rdparty/doctest.h"
#include "zeek/Event.h" #include "zeek/Event.h"
#include "zeek/ZeekString.h" #include "zeek/ZeekString.h"
#include "zeek/analyzer/Manager.h" #include "zeek/analyzer/Manager.h"
#include "zeek/analyzer/protocol/pia/PIA.h" #include "zeek/analyzer/protocol/pia/PIA.h"
#include "zeek/3rdparty/doctest.h"
namespace zeek::analyzer { namespace zeek::analyzer {
class AnalyzerTimer final : public zeek::detail::Timer { class AnalyzerTimer final : public zeek::detail::Timer {

View file

@ -1,11 +1,12 @@
#include "zeek/analyzer/protocol/smtp/BDAT.h" #include "zeek/analyzer/protocol/smtp/BDAT.h"
#include "zeek/3rdparty/doctest.h"
#include "zeek/Conn.h" #include "zeek/Conn.h"
#include "zeek/DebugLogger.h" #include "zeek/DebugLogger.h"
#include "zeek/analyzer/protocol/mime/MIME.h" #include "zeek/analyzer/protocol/mime/MIME.h"
#include "zeek/util.h" #include "zeek/util.h"
#include "zeek/3rdparty/doctest.h"
namespace zeek::analyzer::smtp::detail { namespace zeek::analyzer::smtp::detail {

View file

@ -2,7 +2,6 @@
#include <broker/error.hh> #include <broker/error.hh>
#include "zeek/3rdparty/doctest.h"
#include "zeek/Desc.h" #include "zeek/Desc.h"
#include "zeek/File.h" #include "zeek/File.h"
#include "zeek/Func.h" #include "zeek/Func.h"
@ -13,6 +12,8 @@
#include "zeek/broker/data.bif.h" #include "zeek/broker/data.bif.h"
#include "zeek/module_util.h" #include "zeek/module_util.h"
#include "zeek/3rdparty/doctest.h"
using namespace std; using namespace std;
zeek::OpaqueTypePtr zeek::Broker::detail::opaque_of_data_type; zeek::OpaqueTypePtr zeek::Broker::detail::opaque_of_data_type;

View file

@ -2,9 +2,10 @@
#include "zeek/file_analysis/FileReassembler.h" #include "zeek/file_analysis/FileReassembler.h"
#include "zeek/3rdparty/doctest.h"
#include "zeek/file_analysis/File.h" #include "zeek/file_analysis/File.h"
#include "zeek/3rdparty/doctest.h"
namespace zeek::file_analysis { namespace zeek::file_analysis {
class File; class File;

View file

@ -15,7 +15,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "zeek/3rdparty/doctest.h"
#include "zeek/Func.h" #include "zeek/Func.h"
#include "zeek/RunState.h" #include "zeek/RunState.h"
#include "zeek/logging/Manager.h" #include "zeek/logging/Manager.h"
@ -23,6 +22,8 @@
#include "zeek/threading/SerialTypes.h" #include "zeek/threading/SerialTypes.h"
#include "zeek/util.h" #include "zeek/util.h"
#include "zeek/3rdparty/doctest.h"
using namespace std; using namespace std;
using zeek::threading::Field; using zeek::threading::Field;
using zeek::threading::Value; using zeek::threading::Value;

View file

@ -10,11 +10,12 @@
#include <sys/types.h> #include <sys/types.h>
#include <memory> #include <memory>
#include "zeek/3rdparty/doctest.h"
#include "zeek/IP.h" #include "zeek/IP.h"
#include "zeek/IPAddr.h" #include "zeek/IPAddr.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/3rdparty/doctest.h"
const char* transport_proto_string(TransportProto proto) { const char* transport_proto_string(TransportProto proto) {
switch ( proto ) { switch ( proto ) {
case TRANSPORT_TCP: return "tcp"; case TRANSPORT_TCP: return "tcp";

View file

@ -15,7 +15,6 @@
#include <algorithm> #include <algorithm>
#include <thread> #include <thread>
#include "zeek/3rdparty/doctest.h"
#include "zeek/Func.h" #include "zeek/Func.h"
#include "zeek/ID.h" #include "zeek/ID.h"
#include "zeek/IPAddr.h" #include "zeek/IPAddr.h"
@ -26,6 +25,8 @@
#include "zeek/telemetry/Timer.h" #include "zeek/telemetry/Timer.h"
#include "zeek/threading/formatters/detail/json.h" #include "zeek/threading/formatters/detail/json.h"
#include "zeek/3rdparty/doctest.h"
namespace zeek::telemetry { namespace zeek::telemetry {
/** /**

View file

@ -46,7 +46,6 @@
#include <vector> #include <vector>
#include "zeek/3rdparty/ConvertUTF.h" #include "zeek/3rdparty/ConvertUTF.h"
#include "zeek/3rdparty/doctest.h"
#include "zeek/Desc.h" #include "zeek/Desc.h"
#include "zeek/Hash.h" #include "zeek/Hash.h"
#include "zeek/NetVar.h" #include "zeek/NetVar.h"
@ -60,6 +59,8 @@
#include "zeek/iosource/Manager.h" #include "zeek/iosource/Manager.h"
#include "zeek/iosource/PktSrc.h" #include "zeek/iosource/PktSrc.h"
#include "zeek/3rdparty/doctest.h"
using namespace std; using namespace std;
extern const char* proc_status_file; extern const char* proc_status_file;

View file

@ -20,9 +20,6 @@
#include "zeek/3rdparty/sqlite3.h" #include "zeek/3rdparty/sqlite3.h"
#endif #endif
#define DOCTEST_CONFIG_IMPLEMENT
#include "zeek/3rdparty/doctest.h"
#include "zeek/Anon.h" #include "zeek/Anon.h"
#include "zeek/DFA.h" #include "zeek/DFA.h"
#include "zeek/DNS_Mgr.h" #include "zeek/DNS_Mgr.h"
@ -77,6 +74,9 @@ extern "C" {
#include "zeek/3rdparty/setsignal.h" #include "zeek/3rdparty/setsignal.h"
}; };
#define DOCTEST_CONFIG_IMPLEMENT
#include "zeek/3rdparty/doctest.h"
zeek::detail::ScriptCoverageManager zeek::detail::script_coverage_mgr; zeek::detail::ScriptCoverageManager zeek::detail::script_coverage_mgr;
#ifndef HAVE_STRSEP #ifndef HAVE_STRSEP