-
Notifications
You must be signed in to change notification settings - Fork 81
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
fix: unset PRJ_ROOT to prevent impure behavior #220
Conversation
To give a bit more context, I faced this issue while using devshell which automatically sets the The combination of |
cc #219 I think the flake-parts module may still be broken after this, cf. Lines 43 to 50 in c9f9703
|
Or maybe not? Anyway I was thinking that making |
Well, I don't know where this should be fix. Of course, there might be a cleaner solution. |
Right. The potential alternative, I guess, is to make (This needs rebasing, by the way, I think.) |
I don't see why we would want impure environment variables leaking through to treefmt? Isn't it possible that |
Well, I think searching for the project root is kind of inherently impure to begin with. But sure, that’s fair enough. ( |
2dfba1a
to
cde64c6
Compare
This is a bug in treefmt. Env vars should not take precedence over CLI args. |
I'll merge this for now (given upstream doesn't think this is an issue) |
When the
PRJ_ROOT
environment variable is set,treefmt
will use it to populate the--tree-root
option.Also, both
--tree-root
and--tree-root-file
options must not be set at the same time, otherwise leading to:As the tree-fmt module is explicitly setting
--tree-root-file
, I don't see a justification to letPRJ_ROOT
leak in this script.