just
just copied to clipboard
Variable substitution in doc comment
It would be useful to have variable substitution in a task doc comment:
# Run the primary CI test (PostgreSQL {{ PROD_POSTGRESQL }})
ci-test-primary: createdb test dropdb
This did not work, as it only shows the literal {{ PROD_POSTGRESQL }} and does not substitute the variable value (which is set). This would make the output of just --list somewhat more dynamic.
I think the easiest way to do this is to add a doc attribute, which allows using an expression as the doc comment:
[doc("Run the primary CI test (PostgreSQL " + PROD_POSTGRESQL + ")")]
ci-test-primary: createdb test dropdb
I think this would be relatively easy. When we eventually have interpolation in strings, it could be written as:
[doc(f"Run the primary CI test (PostgreSQL {{PROD_POSTGRESQL)")]
ci-test-primary: createdb test dropdb