hashicorp / hashicorp/hcl

Template function namespaces

Open
#357 2 comments 0 reactions 0 assignees View on GitHub
enhancement syntax/native v2
Dominant language
Go
Stars
5.8k
Forks
657
Avg merge
20h 36m
Merged PRs (30d)
6

Description

I would like to provide a comprehensive suite of functions to my templates. Sadly the only separator character available for function names (Identifier) is "_".

Given the following template:
```hcl
// Ideal
${config:fetch("keyname", "default")}
// or
${config::fetch("keyname", "default")}
// Less ideal
${config.fetch("keyname", "default")}
```
Is there any way I can accomplish such a thing?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the HCL template expression parser and the rules for function-name identifiers; the issue does not name a file or test entry point. Compare the requested colon, double-colon, and dot namespace forms, then establish the accepted syntax and corresponding test coverage before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.