diff --git a/cmd/batch.go b/cmd/batch.go index b05c706f..578b0f13 100644 --- a/cmd/batch.go +++ b/cmd/batch.go @@ -419,12 +419,7 @@ func (b *Batch) WriteChanges(changes []core.Change) error { if b.config.KindFormat != "" && lastKind != change.Kind { lastKind = change.Kind - newKind := b.config.KindFromKeyOrLabel(change.Kind) - if newKind == nil { - return fmt.Errorf("kind not found by key or label: '%s'", change.Kind) - } - kindHeader := b.config.KindHeader(change.Kind) err := b.WriteTemplate( diff --git a/cmd/batch_test.go b/cmd/batch_test.go index ac3af4f5..43a73e32 100644 --- a/cmd/batch_test.go +++ b/cmd/batch_test.go @@ -545,27 +545,6 @@ func TestBatchWriteChanges(t *testing.T) { then.Equals(t, expected, builder.String()) } -func TestBatchWriteChangesWithInvalidKind(t *testing.T) { - cfg := batchTestConfig() - then.WithTempDirConfig(t, cfg) - - var builder strings.Builder - - batch := NewBatch(time.Now, core.NewTemplateCache()) - batch.config = cfg - batch.writer = &builder - - changes := []core.Change{ - {Kind: "added", Body: "w"}, - {Kind: "added", Body: "x"}, - {Kind: "removed", Body: "y"}, - {Kind: "removed not found", Body: "z"}, - } - - err := batch.WriteChanges(changes) - then.NotNil(t, err) -} - func TestBatchCreateVersionsWithoutKindHeaders(t *testing.T) { cfg := batchTestConfig() cfg.KindFormat = ""