Skip to content

Commit

Permalink
test: validate go templates with go (#30)
Browse files Browse the repository at this point in the history
* test: parse testcases with gotemplate

this ensures all testcases obey the gotemplate grammar
and we are compatible with the official implementation

* chore: remove seperator from testnames

* test: add go test to package.json

* chore: setup go in ci

* fix: block argument is not optional

* chore: generate grammar

* test: refactor loop

* test: split string constant test

* chore: replace for with range loop

* fix: merge fix

* typo

Co-authored-by: Guilherme Soares <[email protected]>

* chore: cleanup

---------

Co-authored-by: Guilherme Soares <[email protected]>
  • Loading branch information
qvalentin and guilhas07 authored Jan 29, 2025
1 parent 845c471 commit 5f19a36
Show file tree
Hide file tree
Showing 13 changed files with 6,468 additions and 7,236 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- uses: actions/setup-node@v3
with:
node-version: '18'
Expand Down
20 changes: 6 additions & 14 deletions dialects/helm/src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,20 +566,12 @@
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_pipeline"
}
},
{
"type": "BLANK"
}
]
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_pipeline"
}
},
{
"type": "SYMBOL",
Expand Down
2 changes: 1 addition & 1 deletion dialects/helm/src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"fields": {
"argument": {
"multiple": false,
"required": false,
"required": true,
"types": [
{
"type": "assignment",
Expand Down
Loading

0 comments on commit 5f19a36

Please sign in to comment.