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

command/format: Correctly quote diff object keys #30766

Merged
merged 1 commit into from Apr 1, 2022

Commits on Mar 30, 2022

  1. command/format: Correctly quote diff object keys

    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>
    alisdair and kmoe committed Mar 30, 2022
    Copy the full SHA
    a7ead87 View commit details
    Browse the repository at this point in the history