Skip to content

Commit bd3a647

Browse files
committed
Adding HCL no build directive
1 parent fa42080 commit bd3a647

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

agents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Key methods:
136136
- Use build tags for optional compilation
137137
- Add comprehensive tests
138138
- Handle errors gracefully
139+
- Add the no build directive, like the xml encoder and decoder, that enables a minimal yq builds. e.g. `//go:build !yq_<format>`. Be sure to also updqate the build_small-yq.sh and build-tinygo-yq.sh to not include the new format.
139140

140141
**DON'T:**
141142
- Modify `candidate_node.go` to add format-specific logic

pkg/yqlib/decoder_hcl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !yq_nohcl
2+
13
package yqlib
24

35
import (

pkg/yqlib/encoder_hcl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !yq_nohcl
2+
13
package yqlib
24

35
import (

pkg/yqlib/no_hcl.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build yq_nohcl
2+
3+
package yqlib
4+
5+
func NewHclDecoder() Decoder {
6+
return nil
7+
}
8+
9+
func NewHclEncoder() Encoder {
10+
return nil
11+
}

project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ tinygo
268268
nonexistent
269269
hclsyntax
270270
hclwrite
271+
nohcl
271272
zclconf
272273
cty
273274
go-cty

scripts/build-small-yq.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
go build -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson" -ldflags "-s -w" .
2+
go build -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson yq_nohcl" -ldflags "-s -w" .

scripts/build-tinygo-yq.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

33
# Currently, the `yq_nojson` feature must be enabled when using TinyGo.
4-
tinygo build -no-debug -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson yq_nocsv yq_nobase64 yq_nouri yq_noprops yq_nosh yq_noshell" .
4+
tinygo build -no-debug -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson yq_nocsv yq_nobase64 yq_nouri yq_noprops yq_nosh yq_noshell yq_nohcl" .

0 commit comments

Comments
 (0)