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

Added explicit initialization order to packages #182

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

Hydrocharged
Copy link
Collaborator

@Hydrocharged Hydrocharged commented Apr 18, 2024

This replaces all of the init() functions throughout the project with a package-level Init() function that is called from a new initialization package. This now gives an explicit ordering to the calls. The biggest disadvantage of this approach is that some packages cannot have package-level tests that can access package-private variables without potentially causing import cycles if they need to initialize another package. This was also a limitation with the previous init() approach as well, but the vast majority of our tests are done from the testing subdirectories (in part due to this limitation), so we've not lost anything by changing to this approach.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely an improvement, LGTM

@Hydrocharged Hydrocharged merged commit b7f4ff1 into main Apr 23, 2024
11 checks passed
@Hydrocharged Hydrocharged deleted the daylon/init-order branch April 23, 2024 00:06
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.

2 participants