8000 Fail on missing interpolatable variables by lefou · Pull Request #4983 · com-lihaoyi/mill · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fail on missing interpolatable variables #4983

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

Merged
merged 4 commits into from
Apr 24, 2025

Conversation

lefou
Copy link
Member
@lefou lefou commented Apr 24, 2025

Interpolating missing variable to the empty string ("") is error prone, possibly dangerous and hard to debug. Hence, this change makes it a hard failure when a variable is missing.

Interpolating missing variable to "" is error prone, possibly dangerous and hard to debug.
@lefou lefou marked this pull request as ready for review April 24, 2025 11:33
@lefou lefou requested a review from lihaoyi April 24, 2025 15:00
@lihaoyi
Copy link
Member
lihaoyi commented Apr 24, 2025

I think this looks reasonable to try and enforce, but we should have some story around how to handle optional environment variables. I don't know the exact use cases that those would apply, but I imagine having something like mill-java-opts: ["--jobs=${NUM_THREADS or 0}"] would be a use case people may have.

@lefou
Copy link
Member Author
lefou commented Apr 24, 2025

We should use whatever is common in POSIX shells for that task. I think in bash it is ${VAR:-default_value}.

@lefou
Copy link
Member Author
lefou commented Apr 24, 2025

Since default value support is a new feature, I think it's best to do it in a separate PR.

@lihaoyi
Copy link
Member
lihaoyi commented Apr 24, 2025

Sounds good, feel free to merge this then

@lefou lefou merged commit 6eb17c6 into com-lihaoyi:main Apr 24, 2025
46 checks passed
@lefou lefou deleted the tr-interpolate-mandatory branch April 24, 2025 15:53
@lefou lefou added this to the 1.0.0-RC1 milestone Apr 24, 2025
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
0