Skip to content

Commit

Permalink
💚 ci: fix a syntax error on lint.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jan 12, 2024
1 parent 00de7f6 commit 39cb17c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
- name: Setup Go Faster
uses: WillAbides/setup-go-faster@v1.13.0
timeout-minutes: 3
with:
go-version: *

- name: Revive lint check
uses: docker://morphy/revive-action:v2.5.5
Expand Down
12 changes: 1 addition & 11 deletions hclv2/hcl_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,8 @@ import (

// Decoder the hcl content decoder
var Decoder config.Decoder = func(blob []byte, v any) (err error) {
// TODO hcl2 decode data to map ptr will report error
return hclsimple.Decode("hcl2/config.hcl", blob, nil, v)
// file, diags := hclsyntax.ParseConfig(
// blob,
// "hcl2/config.hcl",
// hcl.Pos{Line: 0, Column: 0},
// )
// // if diags.HasErrors() {
// if len(diags) != 0 {
// return diags
// }
//
// return gohcl.DecodeBody(file.Body, nil, v)
}

// Encoder the hcl content encoder
Expand Down
23 changes: 23 additions & 0 deletions hclv2/hcl_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ func TestDriver(t *testing.T) {
is.Err(err)
}

func TestHcl2Package(t *testing.T) {
hclStr := `io_mode = "async"
service "http" "web_proxy" {
listen_addr = "127.0.0.1:8080"
process "main" {
command = ["/usr/local/bin/awesome-app", "server"]
}
process "mgmt" {
command = ["/usr/local/bin/awesome-app", "mgmt"]
}
}`

mp := make(map[string]any)
// mp := make(map[string]cty.Type)
// err := hclsimple.Decode("test.hcl", []byte(hclStr), nil, &mp)
// assert.NoErr(t, err)
dump.P(hclStr, mp)
t.Skip("Not completed")
}

func TestLoadFile(t *testing.T) {
is := assert.New(t)
c := config.NewEmpty("test")
Expand Down

0 comments on commit 39cb17c

Please sign in to comment.