Skip to content

Commit

Permalink
Added include sorting and ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
UE4SS committed Dec 14, 2024
1 parent 4fc8691 commit ebd74b9
Show file tree
Hide file tree
Showing 137 changed files with 548 additions and 404 deletions.
35 changes: 34 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,38 @@ PenaltyBreakBeforeFirstCallParameter: 120
PenaltyExcessCharacter: 5
PointerAlignment: Left
Standard: Latest
SortIncludes: false
SortIncludes: CaseSensitive
# Uncomment MainIncludeChar when clang-format 19 is commonly used.
#MainIncludeChar: "Any"
IncludeBlocks: Regroup
IncludeCategories:
# Unreal.
- Regex: '^<(Unreal\/)'
Priority: 3
CaseSensitive: true
# First-party dependencies.
- Regex: '^<ArgsParser|ASMHelper|Constructs|DynamicOutput|File|Function|Helpers|IniParser|Input|JSON|LuaMadeSimple|LuaRaw|MProgram|ParserBase|Profiler|ScopedTimer|SigScanner|String\/.+>'
Priority: 2
CaseSensitive: true
# UE4SS Project files.
- Regex: '^<[A-Z].+.hpp>'
Priority: 1
CaseSensitive: true
# C++ Standard files.
- Regex: '^<([^.]+)>$'
Priority: 97
CaseSensitive: true
# Windows.h.
- Regex: 'Windows.h'
Priority: 98
CaseSensitive: false
# Windows sub-headers.
- Regex: 'Psapi.h|ImageHlp.h|tchar.h|tlhelp32.h'
Priority: 99
CaseSensitive: false
# Everything else, and we use this to ensure Windows includes is actually at the bottom, without this it won't be.
# This includes third-party dependencies.
- Regex: '.+'
Priority: 96
CaseSensitive: false
...
4 changes: 2 additions & 2 deletions UE4SS/include/ExceptionHandling.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once

#include <stdexcept>

#include <DynamicOutput/DynamicOutput.hpp>
#include <Helpers/String.hpp>

#include <stdexcept>

#define UE4SS_ERROR_OUTPUTTER() \
if (!Output::has_internal_error()) \
{ \
Expand Down
9 changes: 5 additions & 4 deletions UE4SS/include/GUI/Console.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma once

#include <mutex>
#include <string>
#include <vector>

#include <DynamicOutput/OutputDevice.hpp>

#include <TextEditor.h>
#include <imgui.h>

#include <mutex>
#include <string>
#include <vector>

using namespace RC;

namespace RC::GUI
Expand Down
10 changes: 6 additions & 4 deletions UE4SS/include/GUI/GUI.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#pragma once

#include <functional>
#include <memory>
#include <thread>

#include <GUI/Console.hpp>
#include <GUI/GUITab.hpp>
#include <GUI/LiveView.hpp>

#include <Helpers/String.hpp>

#include <imgui.h>

#include <functional>
#include <memory>
#include <thread>

struct ImGuiSettingsHandler;

namespace RC::GUI
Expand Down
5 changes: 3 additions & 2 deletions UE4SS/include/GUI/GUITab.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include <utility>
#include <GUI/GUI.hpp>

#include <File/Macros.hpp>
#include <GUI/GUI.hpp>

#include <utility>

namespace RC
{
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/GUI/ImGuiUtility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <JSON/JSON.hpp>
// #include <JSONParser/JSON.hpp>
#include <JSON/Parser/Parser.hpp>

#include <imgui.h>

namespace RC::GUI
Expand Down
9 changes: 5 additions & 4 deletions UE4SS/include/GUI/LiveView.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#pragma once

#include <DynamicOutput/DynamicOutput.hpp>

#include <Unreal/UFunctionStructs.hpp>
#include <Unreal/UnrealFlags.hpp>

#include <functional>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <variant>
#include <vector>

#include <DynamicOutput/DynamicOutput.hpp>
#include <Unreal/UFunctionStructs.hpp>
#include <Unreal/UnrealFlags.hpp>

namespace RC::Unreal
{
struct FUObjectItem;
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/GUI/LiveView/Filter/ClassNamesFilter.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <GUI/LiveView/Filter/SearchFilter.hpp>

#include <Unreal/UClass.hpp>

namespace RC::GUI::Filter
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/GUI/LiveView/Filter/FunctionParamFlags.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <GUI/LiveView/Filter/SearchFilter.hpp>

#include <Unreal/FProperty.hpp>
#include <Unreal/UFunction.hpp>

Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/GUI/LiveView/Filter/HasProperty.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <GUI/LiveView/Filter/SearchFilter.hpp>

#include <Unreal/UClass.hpp>

namespace RC::GUI::Filter
Expand Down
4 changes: 3 additions & 1 deletion UE4SS/include/GUI/LiveView/Filter/HasPropertyType.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#pragma once

#include <GUI/LiveView/Filter/SearchFilter.hpp>
#include <Unreal/UClass.hpp>

#include <Unreal/NameTypes.hpp>
#include <Unreal/UClass.hpp>

#include <vector>

namespace RC::GUI::Filter
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/GUI/LiveView/Filter/NonInstancesOnly.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <GUI/LiveView/Filter/SearchFilter.hpp>

#include <Unreal/UFunction.hpp>

namespace RC::GUI::Filter
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/GUI/UFunctionCallerWidget.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once

#include <GUI/SearcherWidget.hpp>

#include <string>
#include <vector>

#include <GUI/SearcherWidget.hpp>

namespace RC::Unreal
{
class UObject;
Expand Down
7 changes: 4 additions & 3 deletions UE4SS/include/LuaCustomMemberFunctions.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#pragma once

#include <unordered_map>

#include <Unreal/Core/HAL/Platform.hpp>
#include <Unreal/Core/Containers/ScriptArray.hpp>
#include <Unreal/Core/HAL/Platform.hpp>
#include <Unreal/Property/FArrayProperty.hpp>
#include <Unreal/Property/FObjectProperty.hpp>
#include <Unreal/UObject.hpp>
#include <Unreal/UScriptStruct.hpp>

#include <lua.hpp>

#include <unordered_map>

namespace RC
{
extern std::unordered_map<Unreal::FName, Unreal::UScriptStruct*> g_script_struct_cache_map;
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaLibrary.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#pragma once

#include <Common.hpp>
#include <cstdint>

#include <String/StringType.hpp>

#include <cstdint>

#define DefaultStructMemberData(member_name) \
union { \
const char* as_string{}; \
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/LuaTests.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once

#include <cstdint>

#include <Unreal/Core/Containers/Array.hpp>
#include <Unreal/World.hpp>

#include <cstdint>

namespace RC
{
using namespace Unreal;
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaType/LuaAActor.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include <LuaMadeSimple/LuaMadeSimple.hpp>
#include <LuaType/LuaUObject.hpp>

#include <LuaMadeSimple/LuaMadeSimple.hpp>

namespace RC::Unreal
{
class AActor;
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/LuaType/LuaCustomProperty.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include <String/StringType.hpp>

#include <memory>
#include <string>
#include <vector>

#include <String/StringType.hpp>

namespace RC::Unreal
{
class UObject;
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/LuaType/LuaFName.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <LuaType/LuaUObject.hpp>

#include <Unreal/NameTypes.hpp>

namespace RC::LuaType
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/LuaType/LuaFSoftObjectPath.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <LuaType/LuaUObject.hpp>

#include <Unreal/Property/FSoftObjectProperty.hpp>

namespace RC::LuaType
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaType/LuaFText.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include <LuaMadeSimple/LuaMadeSimple.hpp>
#include <LuaType/LuaUObject.hpp>

#include <LuaMadeSimple/LuaMadeSimple.hpp>

namespace RC::Unreal
{
class FText;
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/LuaType/LuaFURL.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <LuaType/LuaUObject.hpp>

#include <Unreal/FURL.hpp>

namespace RC::LuaType
Expand Down
1 change: 1 addition & 0 deletions UE4SS/include/LuaType/LuaTSoftClassPtr.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <LuaType/LuaUObject.hpp>

#include <Unreal/Property/FSoftClassProperty.hpp>

namespace RC::LuaType
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaType/LuaUClass.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include <LuaMadeSimple/LuaObject.hpp>
#include <LuaType/LuaUObject.hpp>
#include <LuaType/LuaUStruct.hpp>

#include <LuaMadeSimple/LuaObject.hpp>

namespace RC::Unreal
{
class UClass;
Expand Down
5 changes: 3 additions & 2 deletions UE4SS/include/LuaType/LuaUFunction.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include <array>
#include <LuaType/LuaUObject.hpp>

#include <LuaMadeSimple/LuaMadeSimple.hpp>
#include <LuaType/LuaUObject.hpp>

#include <array>

namespace RC::Unreal
{
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaType/LuaUInterface.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include <LuaMadeSimple/LuaObject.hpp>
#include <LuaType/LuaUObject.hpp>
#include <LuaType/LuaUStruct.hpp>

#include <LuaMadeSimple/LuaObject.hpp>

namespace RC::Unreal
{
class UInterface;
Expand Down
9 changes: 5 additions & 4 deletions UE4SS/include/LuaType/LuaUObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

#define NOMINMAX

#include <format>
#include <functional>
#include <Common.hpp>
#include <LuaType/LuaCustomProperty.hpp>

#include <Constructs/Generator.hpp>
#include <DynamicOutput/DynamicOutput.hpp>
#include <Helpers/String.hpp>
#include <Common.hpp>
#include <LuaMadeSimple/LuaObject.hpp>
#include <LuaType/LuaCustomProperty.hpp>

#include <format>
#include <functional>
#pragma warning(disable : 4005)
#include <Unreal/FOutputDevice.hpp>
#include <Unreal/FProperty.hpp>
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaType/LuaUStruct.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include <LuaMadeSimple/LuaObject.hpp>
#include <LuaType/LuaUObject.hpp>

#include <LuaMadeSimple/LuaObject.hpp>

namespace RC::Unreal
{
class UStruct;
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/include/LuaType/LuaUWorld.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include <LuaMadeSimple/LuaObject.hpp>
#include <LuaType/LuaUObject.hpp>

#include <LuaMadeSimple/LuaObject.hpp>

namespace RC::Unreal
{
class UWorld;
Expand Down
Loading

0 comments on commit ebd74b9

Please sign in to comment.