Skip to content

Improve string escaping for HCL interpolation#224

Merged
kkozik-amplify merged 3 commits intoamplify-education:mainfrom
eranor:unicode-bug-fix
May 5, 2025
Merged

Improve string escaping for HCL interpolation#224
kkozik-amplify merged 3 commits intoamplify-education:mainfrom
eranor:unicode-bug-fix

Conversation

@eranor
Copy link
Contributor

@eranor eranor commented Apr 17, 2025

Revised _escape_interpolated_str to handle heredoc strings and added more robust escaping for special characters.

Added tests and a sample HCL file to validate various unicode and complex string scenarios.

Revised `_escape_interpolated_str` to handle heredoc strings and added more robust escaping for special characters. Added tests and a sample HCL file to validate various unicode and complex string scenarios, ensuring accurate handling and output.
@eranor eranor requested a review from a team as a code owner April 17, 2025 01:23
@kkozik-amplify
Copy link
Collaborator

kkozik-amplify commented Apr 18, 2025

Please add test/helpers/terraform-config-json/unicode_strings.json file with JSON equivalent of the terraform test file. (I also believe you can remove the test/unit/test_unicode_strings.py test file whatsoever).
Make sure test suite and pre-commit pass locally. Let me know in case of any issues.
Thank you for contributing!

@kkozik-amplify kkozik-amplify self-assigned this Apr 18, 2025
- Replace `test_unicode_strings.py` with `unicode_strings.json`
@eranor
Copy link
Contributor Author

eranor commented May 5, 2025

@kkozik-amplify I've made the requested changes.

@kkozik-amplify kkozik-amplify merged commit 89ad71c into amplify-education:main May 5, 2025
10 checks passed
kkozik-amplify added a commit that referenced this pull request May 5, 2025
kkozik-amplify added a commit that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants