You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
strip_string_quotes=True turns a literal inside %{ ... } into a bare reference #341
TemplateStringRule.serialize strips the " delimiters whenever strip_string_quotes is set. That rule only ever appears inside a template
directive, where the text is expression source -- so the delimiters it removes
are a string literal's, not the template's.
Reproduction
hcl2.loads('a = "%{ if x == \\"y\\" }t%{ endif }"\n',
serialization_options=SerializationOptions(strip_string_quotes=True))["a"]
# '%{ if x == y }t%{ endif }'
The literal "y" has become a reference to y: a different expression, not a
different spelling of the same one. TemplateStringRule.serialize is hcl2/rules/strings.py:269 at v8.1.3. The source form is correct; only the
value form is affected.
Same root cause as #E above -- a rule inside expression source treating it as
literal text -- but a different rule, so it is filed separately.
This issue, and the investigation behind it, were produced by an AI assistant (Claude) working on behalf of the author. Please review with that provenance in mind.
Activity
fix: keep the value-form fixes, drop the default-path change (amplify…