-
-
Couldn't load subscription status.
- Fork 38
Fix: mix format crashes in umbrella projects #230
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
base: main
Are you sure you want to change the base?
Fix: mix format crashes in umbrella projects #230
Conversation
Skips compilation at umbrella root to avoid Mix.ProjectStack violations. The compile task added in 9eddbeb (fixing ash-project#228) causes crashes in umbrella projects because Mix.ProjectStack doesn't support recursive compilation during format operations.
|
I've added some more logic here, mind pulling and updating? Thank you for the fix 🙇 |
|
Thanks, Zach. LGTM for the merge. |
|
Not sure if I messed it up again but there are still conflicts 😢 |
|
Not sure what the issue is? When I run the tests on my side on the PR branch in my fork, I get clean tests: What conflicts are you seeing? Or are you referring to the merge conflict below on Let me see if I can fix it on my side ... ok, should be good go now. |
Resolved conflict in lib/spark/formatter.ex by updating safe_compile() to include the loadpaths tasks from main (v2.3.11) while preserving the umbrella project safety check. This combines: - The umbrella crash fix (skips compilation in umbrella projects) - The loadpaths fix from v2.3.11
|
Please fix credo then I'll merge 🙇 |
|
Done. |
Running
mix formatat umbrella root crashes with a MatchError in Mix.ProjectStack.The Problem
The fix for #228 (commits 9eddbeb and 0d1048a) added compilation before formatting
to ensure modules are available. This breaks umbrella projects because calling
Mix.Task.run("compile")from within a formatter plugin triggers recursivecompilation, violating Mix.ProjectStack's expectations.
Changes
safe_compile/0that checksMix.Project.umbrella?()before compilingFixes #231