-
Notifications
You must be signed in to change notification settings - Fork 499
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
Implement the private attribute for assignments #2300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [private]
attribute on recipes doesn't prevent running private them, only listing them, and I'm inclined to think the [private]
variable attribute should similar, i.e., only prevent listing them, but still allow overriding them.
I would also filter them out of |
I believe this is ready again. Haven't implemented the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed this the first time! I would remove the allow-private-variables
setting, since I think an --all
flag, which can be added later, is more useful and general.
Ah sure, I assumed that would be a backwards-incompatible change |
Using the But wouldn't making all underscore-prefixed variables private be backwards-incompatible, and therefore that aspect would need an opt-in setting? |
@laniakea64 Yeah, that's what I thought. I could take out the |
It could be argued either way, but I think making variables private if they start with |
This reverts commit 4f2128f.
f6c0842
to
7b2f886
Compare
Removed the setting @casey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Available in 1.35.0, just released: https://github.com/casey/just/releases/tag/1.35.0 |
Follow up to casey#2300
This PR fixes #2299. When a variable is specified as
[private]
or is named with_*
the variable will be hidden fromjust --variables
and forbidden from being overridden. I purposefully didn't change the behavior of the evaluator on private variables since it's likely useful to be able to view the values of private variables for debugging & introspection.