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

Include sorting #718

wants to merge 2 commits into from

Conversation

UE4SS
Copy link
Collaborator

@UE4SS UE4SS commented Dec 13, 2024

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.

Copy link
Contributor

github-actions bot commented Dec 13, 2024

MSVC-Game__Debug__Win64 Download Logs
Build Details
Name Information
PR Commit 73eb08f
Merge Commit 59724f6
Size 46.43 MB
Last Updated Dec 14, 24, 3:10:25 PM UTC
Expires At Dec 28, 24, 3:10:20 PM UTC

MSVC-Game__Shipping__Win64 Download Logs
Build Details
Name Information
PR Commit 73eb08f
Merge Commit 59724f6
Size 28.13 MB
Last Updated Dec 14, 24, 3:14:18 PM UTC
Expires At Dec 28, 24, 3:14:16 PM UTC

@localcc localcc self-requested a review December 13, 2024 22:21
@Buckminsterfullerene02
Copy link
Member

Builds fine for me on windows and on msvc-wine

@localcc
Copy link
Contributor

localcc commented Dec 13, 2024

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

@narknon
Copy link
Collaborator

narknon commented Dec 14, 2024

Can you do the existing Clang format first in one PR and then the include things separate?

@UE4SS
Copy link
Collaborator Author

UE4SS commented Dec 14, 2024

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.

@UE4SS UE4SS marked this pull request as draft December 14, 2024 14:33
This only applies to UE4SS, and it's first-party dependencies, except for Unreal, patternsleuth, and patternsleuth-bind.
@UE4SS UE4SS marked this pull request as ready for review December 14, 2024 14:56
@UE4SS
Copy link
Collaborator Author

UE4SS commented Dec 14, 2024

This should be ready now.

@narknon
Copy link
Collaborator

narknon commented Dec 19, 2024

Does it have to Alpha sort all groups? Also can imagine some scenarios where Unreal includes should be the first group.

@UE4SS
Copy link
Collaborator Author

UE4SS commented Dec 19, 2024

Does it have to Alpha sort all groups? Also can imagine some scenarios where Unreal includes should be the first group.

  1. Why shouldn't it be alpha sorted ?
  2. What scenarios ? The entire project builds as it is.

@UE4SS
Copy link
Collaborator Author

UE4SS commented Dec 19, 2024

Does it have to Alpha sort all groups?

I just checked, and as far as I could tell it's not possible to have groups without sorting the contents of each group.

@narknon
Copy link
Collaborator

narknon commented Dec 19, 2024

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.

@UE4SS UE4SS closed this Dec 19, 2024
@UE4SS UE4SS deleted the include-sorting branch December 26, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants