Skip to content

for_object_expr: allow ellipsis in separate line #221

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

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Issue parsing ellipsis in a separate line within `for` expression ([#221](https://github.com/amplify-education/python-hcl2/pull/221))
- Issue parsing inline expression as an object key; **see Limitations in README.md** ([#222](https://github.com/amplify-education/python-hcl2/pull/222))

## \[7.1.0\] - 2025-04-10
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/terraform-config-json/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"empty_tuple": []
},
{
"route53_forwarding_rule_shares": "${{for forwarding_rule_key in keys(var.route53_resolver_forwarding_rule_shares) : \"${forwarding_rule_key}\" => {\"aws_account_ids\": \"${[for account_name in var.route53_resolver_forwarding_rule_shares[forwarding_rule_key].aws_account_names : module.remote_state_subaccounts.map[account_name].outputs[\"aws_account_id\"]]}\"}}}",
"route53_forwarding_rule_shares": "${{for forwarding_rule_key in keys(var.route53_resolver_forwarding_rule_shares) : \"${forwarding_rule_key}\" => {\"aws_account_ids\": \"${[for account_name in var.route53_resolver_forwarding_rule_shares[forwarding_rule_key].aws_account_names : module.remote_state_subaccounts.map[account_name].outputs[\"aws_account_id\"]]}\"} ...}}",
"has_valid_forwarding_rules_template_inputs": "${(length(keys(var.forwarding_rules_template.copy_resolver_rules)) > 0 && length(var.forwarding_rules_template.replace_with_target_ips) > 0 && length(var.forwarding_rules_template.exclude_cidrs) > 0)}",
"for_whitespace": "${{for i in [1, 2, 3] : i => i}}"
"for_whitespace": "${{for i in [1, 2, 3] : i => i ...}}"
},
{
"nested_data": [
Expand Down
3 changes: 2 additions & 1 deletion test/helpers/terraform-config/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ locals {
module.remote_state_subaccounts.map[account_name].outputs["aws_account_id"]
]
}
...
}
has_valid_forwarding_rules_template_inputs = (
length(keys(var.forwarding_rules_template.copy_resolver_rules)) > 0
Expand All @@ -74,7 +75,7 @@ locals {

for_whitespace = { for i in [1, 2, 3] :
i =>
i
i ...
}
}

Expand Down