diff --git a/docs/configuring.md b/docs/configuring.md index 47c9d2800..9f5a4d375 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -902,7 +902,7 @@ Each pattern can be templated using Jinja. ```yaml _exclude: - - "{%- if _operation == 'update' -%}src/*_example.py{%- endif %}" + - "{% if _operation == 'update' -%}src/*_example.py{% endif %}" ``` !!! info diff --git a/docs/creating.md b/docs/creating.md index 63af2148d..5d2c065b4 100644 --- a/docs/creating.md +++ b/docs/creating.md @@ -131,7 +131,7 @@ Some variables are only available in select contexts: ### `_operation` -The current operation, either `copy` or `update`. +The current operation, either `"copy"` or `"update"`. Availability: [`exclude`](configuring.md#exclude), [`tasks`](configuring.md#tasks) diff --git a/tests/test_context.py b/tests/test_context.py index 19c2527b3..5479c7db1 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -18,7 +18,7 @@ def test_exclude_templating_with_operation( """ src, dst = map(tmp_path_factory.mktemp, ("src", "dst")) - template = r"{%- if _operation == 'update' %}copy-only{%- endif %}" + template = "{% if _operation == 'update' %}copy-only{% endif %}" with local.cwd(src): build_file_tree( {