ast: add DefaultModuleLoader#7794
Merged
srenatus merged 1 commit intoopen-policy-agent:mainfrom Jul 23, 2025
Merged
Conversation
ba5eb8a to
bf1044e
Compare
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
bf1044e to
b0b2913
Compare
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
philipaconrad
left a comment
There was a problem hiding this comment.
This looks great so far! I'd love to add some tests for this, if possible. 😅
b0b2913 to
ac4a94a
Compare
Contributor
Author
|
Test added ✔️ |
This provides the means to inject modules _for all invocations of the ast package in an executable_. It's handy if you want to include your own set of base modules, with helper functions. Since the module loader can be provided via other means, we need to check both possibilities: 1. If there hasn't been a module loader set up before, just use the default module loader. 2. If there had been one set up before, run that first, then run the default one, and merge the results. This can be iterated, of course, if need be -- and should reach a fix point given that the individual loaders do. Signed-off-by: Stephan Renatus <stephan@styra.com>
ac4a94a to
ebd1998
Compare
philipaconrad
approved these changes
Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This provides the means to inject modules for all invocations of the ast package in an executable. It's handy if you want to include your own set of base modules, with helper functions.
Since the module loader can be provided via other means, we need to check both possibilities:
If there hasn't been a module loader set up before, just use the default module loader.
If there had been one set up before, run that first, then run the default one, and merge the results. This can be iterated, of course, if need be -- and should reach a fix point given that the individual loaders do.