mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-24 11:02:30 -05:00
When rendering a diff, we should quote object attribute names if the string representation is not a valid identifier. While this is not strictly necessary, it makes the diff output more closely resemble the configuration language, which is less confusing. This commit applies to both top-level schema attributes and any object value attributes. We use a simplistic "%q" Go format string to quote the strings, which is not strictly identical to HCL's quoting requirements, but is the pattern used elsewhere in HCL and Terraform. Co-Authored-By: Katy Moe <katy@katy.moe> Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>