Skip to content

Commit

Permalink
ensure examples are formatted the same way in processors.json
Browse files Browse the repository at this point in the history
  • Loading branch information
lovromazgon committed Feb 28, 2024
1 parent db0296f commit 4fa0b49
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/Masterminds/sprig/v3 v3.2.3
github.com/NYTimes/gziphandler v1.1.1
github.com/bufbuild/buf v1.29.0
github.com/conduitio/conduit-commons v0.0.0-20240228183204-44c456787a25
github.com/conduitio/conduit-commons v0.0.0-20240228185905-49ce3f31fbcd
github.com/conduitio/conduit-connector-file v0.6.0
github.com/conduitio/conduit-connector-generator v0.5.0
github.com/conduitio/conduit-connector-kafka v0.7.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,8 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWH
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/colinmarc/hdfs/v2 v2.1.1/go.mod h1:M3x+k8UKKmxtFu++uAZ0OtDU8jR3jnaZIAc6yK4Ue0c=
github.com/conduitio/conduit-commons v0.0.0-20240228183204-44c456787a25 h1:AEifS3EV44zg7w3D4ynf9y1iDJTHASTnQdmrpfgb4Co=
github.com/conduitio/conduit-commons v0.0.0-20240228183204-44c456787a25/go.mod h1:Hhr5nik71/Wz3yrLjaKSZ2HRQp1wNSOPY2JGGKz7fsw=
github.com/conduitio/conduit-commons v0.0.0-20240228185905-49ce3f31fbcd h1:BuKtwSyIMzhGWkU7diay5vimV4qJfKQZxMhwNjPaygc=
github.com/conduitio/conduit-commons v0.0.0-20240228185905-49ce3f31fbcd/go.mod h1:Hhr5nik71/Wz3yrLjaKSZ2HRQp1wNSOPY2JGGKz7fsw=
github.com/conduitio/conduit-connector-file v0.6.0 h1:8tsGeGhKvFwYQZztOOL5/tmOhVShsfo9lQ3b/0fX8kQ=
github.com/conduitio/conduit-connector-file v0.6.0/go.mod h1:ju7PiB4kTJgqng4KVXDt/Gvw/53kFwSzi5Ez9EDXxNI=
github.com/conduitio/conduit-connector-generator v0.5.0 h1:zpXHif89DCJ13nftKLv31uI2AJGicpY5H1V7SwldRNo=
Expand Down
11 changes: 6 additions & 5 deletions pkg/plugin/processor/builtin/examples_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
package builtin

import (
"context"
"io"
"log"
"os"
"sort"
"strings"
"testing"

"github.com/conduitio/conduit-commons/opencdc"
"github.com/goccy/go-json"
)

Expand All @@ -48,12 +50,11 @@ func TestMain(m *testing.M) {
func exportProcessors(output io.Writer) {
sorted := sortProcessors(processors)

bytes, err := json.MarshalIndent(sorted, "", " ")
if err != nil {
log.Fatalf("failed to marshal processors to JSON: %v", err)
}
ctx := opencdc.WithJSONMarshalOptions(context.Background(), &opencdc.JSONMarshalOptions{RawDataAsString: true})
enc := json.NewEncoder(output)
enc.SetIndent("", " ")

_, err = output.Write(bytes)
err := enc.EncodeContext(ctx, sorted)
if err != nil {
log.Fatalf("failed to write processors to output: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/processor/builtin/processors.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[]
[]

0 comments on commit 4fa0b49

Please sign in to comment.