Skip to content
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

Support backticks inside defaults #10

Open
jayvdb opened this issue Jul 17, 2019 · 2 comments
Open

Support backticks inside defaults #10

jayvdb opened this issue Jul 17, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@jayvdb
Copy link
Owner

jayvdb commented Jul 17, 2019

FOO={env:FOO:blah} is common enough that users would want to replace blah with backticks.

i.e.

FOO={env:FOO:`do_stuff`}

The problem with that is it takes away valid syntax, as previously that would result in FOO being equal to do_stuff in backticks. While that is not likely to be a common case, it was valid.

Another option is to add a sub_type and then FOO={env:FOO:{backticks:do_stuff}} can be used. That should currently be an error "Unknown sub_type backticks", or similar, so it doesnt remove valid syntax.

This can be done atm using

DEFAULTFOO=`blah`
FOO={env:FOO:{env:DEFAULTFOO}}

But then we run into #9 as DEFAULTFOO needs to be executed even if FOO was defined externally. But trying to determine that DEFAULTFOO is unneeded is hard, as the regex currently being used only returns the innermost env:DEFAULTFOO.

@jayvdb jayvdb added the enhancement New feature or request label Jul 17, 2019
@jayvdb
Copy link
Owner Author

jayvdb commented Feb 6, 2021

#15 is a simpler case, worth doing before this one.

@jayvdb
Copy link
Owner Author

jayvdb commented Feb 6, 2021

Another option is to add a sub_type ... {backticks:...}

The ability to inject sub_types into the tox config parser is a wonderful crazy idea which needs its own tox plugin helper library, with a dedicated regression test, or it needs support in tox. Without support inside tox, currently this would need to inject a modified Replacer, and then we'd need to be sure that any other tox plugin gets the modified Replacer with the new functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant