feat: allow configuring load_paths for non-Rails (Zeitwerk) apps#467
Open
swiknaba wants to merge 3 commits into
Open
feat: allow configuring load_paths for non-Rails (Zeitwerk) apps#467swiknaba wants to merge 3 commits into
swiknaba wants to merge 3 commits into
Conversation
Author
|
I have signed the CLA! |
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.
What are you trying to accomplish?
I want to use it in my non-Rails (but Zeitwerk) apps. Packwerk is like 99% there already. This adds the last missing piece to run the check without loading Railties.
What approach did you choose and why?
There was actually just 1 part that blew up when running this on a non Rails app: file path resolution relied on the Rails load path. It now allows to define load paths in the
packwerk.ymlfile.I also noticed two other minor bugs that blew up when Rails wasn't present. See commit messages :)
=> POC here: swiknaba/kirei#39
=> if #410 get's merged, my PR should be trivial to update. Would need to return a
Zeitwerk::LOaderobject instead of theHash[String, Module].=> #447 makes my PR obsolete if I see it right, since it also removes any hard dependency on Railties. Feel free to discard my PR if 447 gets merged soon anyway.
What should reviewers focus on?
no clue what to write here. Tiny change I believe. Thanks for making this open source <3
Type of Change
Additional Release Notes
Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.
If no additional notes are necessary, delete this section or leave it unchanged.
Checklist
Before
=> from my dummy test app, see link "POC" above
After
=> from my dummy test app, see link "POC" above