-
Notifications
You must be signed in to change notification settings - Fork 189
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
Include sorting #718
Conversation
Builds fine for me on windows and on msvc-wine |
Looks good, I would squish the commits into two though, first one being adding clang-format and running it with all the build fixes, and the second one being git-blame-revs changes |
Can you do the existing Clang format first in one PR and then the include things separate? |
Okay, please merge #719 so that I can redo this PR. |
0b6fdaf
to
d9c7748
Compare
d9c7748
to
67f5a70
Compare
This only applies to UE4SS, and it's first-party dependencies, except for Unreal, patternsleuth, and patternsleuth-bind.
67f5a70
to
73eb08f
Compare
This should be ready now. |
Does it have to Alpha sort all groups? Also can imagine some scenarios where Unreal includes should be the first group. |
|
I just checked, and as far as I could tell it's not possible to have groups without sorting the contents of each group. |
I don't see any benefit at all to alpha sorting, but there are plenty of potential scenarios where it could cause issues. For example, CoreMinimal should almost always be first include for the Unreal group and there are files that start with A. A lot of our types, defines and macros come from the unreal submodule and if they're included later there could be issues with defines not being applied early enough. Sometimes there are files that need to be included in a certain order, particularly around windows includes. Generally they begin with Allow/Hide/Show. Sometimes one or the other needs to be included at the very bottom of a file. This is just one scenario I know of, could be tons of other things we are not aware of. |
Description
This adds include sorting and ordering to UE4SS, and its dependencies except Unreal, patternsleuth, patternsleuth bind and all third-party dependencies.
Before: https://github.com/UE4SS-RE/RE-UE4SS/blob/8f077f6bf92aed0ccb359f916d981c3a63b8cefc/UE4SS/src/UE4SSProgram.cpp
After: https://github.com/UE4SS-RE/RE-UE4SS/blob/2c71ea169ee9265fe95b2cade33d5323f0834ac5/UE4SS/src/UE4SSProgram.cpp
How Has This Been Tested?
Successfully built with msvc-wine.