feat: reorder include statements to ensure corresponding headers are placed first
This commit is contained in:
parent
4ff7a03597
commit
a3e9699eb9
@ -3,9 +3,8 @@
|
||||
./check_iwyu.sh
|
||||
./fix_iwyu_auto.sh
|
||||
|
||||
# Reorder includes to put corresponding header first
|
||||
./reorder_includes.sh
|
||||
|
||||
find webserv -name "*.hpp" -o -name "*.cpp" | xargs sed -i -E 's/#include "(.*)"/#include <\1>/g'
|
||||
find webserv -name "*.cpp" -o -name "*.hpp" | xargs clang-format -i
|
||||
find webserv -name "*.hpp" -exec sh -c 'if ! grep -q "#pragma once" "$1"; then echo "Missing #pragma once in $1"; fi' _ {} \;
|
||||
# Reorder includes to put corresponding header first
|
||||
./reorder_includes.sh
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/client/Client.hpp>
|
||||
|
||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||
#include <webserv/handler/ErrorHandler.hpp> // for ErrorHandler
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
||||
#include <webserv/config/utils.hpp> // for trim
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/config/ConfigManager.hpp>
|
||||
|
||||
#include <webserv/config/GlobalConfig.hpp> // for GlobalConfig
|
||||
#include <webserv/config/utils.hpp> // for removeComments
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/config/GlobalConfig.hpp>
|
||||
|
||||
#include <webserv/config/utils.hpp> // for findCorrespondingClosingBrace
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||
#include <webserv/config/LocationConfig.hpp>
|
||||
|
||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
|
||||
LocationConfig::LocationConfig(const std::string &block, const AConfig *parent) : AConfig(parent)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/ServerConfig.hpp>
|
||||
|
||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
|
||||
#include <webserv/config/ServerConfig.hpp>
|
||||
#include <webserv/config/utils.hpp> // for findCorrespondingClosingBrace, trim
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/config/directive/ADirective.hpp>
|
||||
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValue, operator<<
|
||||
|
||||
DirectiveValue ADirective::getValue() const
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/BoolDirective.hpp> // for IntDirective
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||
#include <webserv/config/utils.hpp> // for trim
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
|
||||
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
||||
|
||||
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
|
||||
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
||||
#include <webserv/config/directive/IntStringDirective.hpp> // for IntStringDirective
|
||||
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
||||
|
||||
IntDirective::IntDirective(const std::string &name, const std::string &value)
|
||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/directive/IntStringDirective.hpp> // for IntDirective
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||
#include <webserv/config/directive/IntStringDirective.hpp> // for IntDirective
|
||||
#include <webserv/config/utils.hpp> // for trim
|
||||
|
||||
#include <sstream> // for basic_istringstream, basic_istream::operator>>, istringstream
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
||||
#include <webserv/config/utils.hpp> // for trim
|
||||
|
||||
#include <algorithm> // for __transform_fn, transform
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/directive/StringDirective.hpp> // for IntDirective
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||
#include <webserv/config/directive/StringDirective.hpp> // for IntDirective
|
||||
|
||||
StringDirective::StringDirective(const std::string &name, const std::string &value)
|
||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/config/directive/VectorDirective.hpp> // for IntDirective
|
||||
|
||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||
#include <webserv/config/directive/VectorDirective.hpp> // for IntDirective
|
||||
|
||||
#include <sstream> // for basic_stringstream, stringstream
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||
|
||||
#include <webserv/config/utils.hpp> // for trim
|
||||
#include <webserv/http/HttpConstants.hpp> // for CRLF
|
||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||
#include <webserv/log/Log.hpp>
|
||||
|
||||
#include <algorithm> // for __transform_fn, transform
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#include <webserv/http/HttpRequest.hpp>
|
||||
|
||||
#include <webserv/client/Client.hpp> // for Client
|
||||
#include <webserv/config/utils.hpp> // for stoul
|
||||
#include <webserv/http/HttpConstants.hpp> // for CRLF, DOUBLE_CRLF, BAD_REQUEST
|
||||
#include <webserv/http/HttpRequest.hpp>
|
||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||
|
||||
#include <map> // for map
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include <webserv/log/FileChannel.hpp>
|
||||
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
|
||||
#include <chrono> // for system_clock
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/log/Log.hpp>
|
||||
|
||||
#include <webserv/log/Channel.hpp> // for Channel
|
||||
#include <webserv/log/FileChannel.hpp> // for FileChannel
|
||||
#include <webserv/log/Log.hpp>
|
||||
#include <webserv/log/StdoutChannel.hpp> // for StdoutChannel
|
||||
|
||||
#include <chrono> // for duration_cast, operator-, steady_clock, duration, seconds
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/log/StdoutChannel.hpp>
|
||||
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
|
||||
#include <iomanip> // for operator<<, setfill, setw
|
||||
#include <iostream> // for basic_ostream, operator<<, basic_ostream::operator<<, cerr, cout, flush, ostream
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
#include <webserv/server/Server.hpp>
|
||||
|
||||
#include <webserv/client/Client.hpp> // for Client
|
||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||
#include <webserv/log/Log.hpp> // for Log
|
||||
#include <webserv/server/Server.hpp>
|
||||
#include <webserv/socket/Socket.hpp> // for Socket
|
||||
|
||||
#include <cerrno> // for errno
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <webserv/log/Log.hpp>
|
||||
#include <webserv/socket/Socket.hpp>
|
||||
|
||||
#include <webserv/log/Log.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user