Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include sorting #718

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
...
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ c3eaefbd993dd0f3c8b9d440b7d5b9cc7528732c

# Ran clang-format before sort-include update
5462e5d96ad2e409f90bb21d33c22e5580ba3260

# Added include sorting and ordering
7244fe48b74884133781f6eb006ad021103fc450
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
2 changes: 2 additions & 0 deletions UE4SS/include/GUI/Dumpers.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <cstdint>

namespace RC::GUI::Dumpers
{
struct MapDumpFileName
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
3 changes: 1 addition & 2 deletions UE4SS/include/LuaType/LuaFWeakObjectPtr.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#pragma once

#include <LuaType/LuaUObject.hpp>
#pragma warning(disable : 4005)

#include <Unreal/FWeakObjectPtr.hpp>
#pragma warning(default : 4005)

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

#include <LuaType/LuaUObject.hpp>
#pragma warning(disable : 4005)

#include <Unreal/Core/Containers/ScriptArray.hpp>
#pragma warning(default : 4005)

namespace RC::Unreal
{
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
Loading
Loading