From 8d397f1900166abc2778d1cc8cb7602c47419485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Cola=C3=A7o?= Date: Tue, 17 Jun 2025 19:39:23 +0200 Subject: [PATCH] fix(footer)!: Allow capitals in footer Spec actually doesn't mention anything about capitals, only mentions that breaking changes is the only one that can have Spaces, therefore capitals are allowed in the footer --- cmd/footer.go | 7 ------- cmd/footer_test.go | 20 -------------------- 2 files changed, 27 deletions(-) diff --git a/cmd/footer.go b/cmd/footer.go index ed44c30..474d097 100644 --- a/cmd/footer.go +++ b/cmd/footer.go @@ -52,18 +52,11 @@ func lintFooter(f []string) (errs []error) { } } - if s[0] == strings.ToUpper(s[0]) { - errs = append(errs, errInvalidFooterUpperCase) - } - if strings.Contains(s[0], " ") { errs = append(errs, errInvalidFooterSpace) } } - if s[1] == strings.ToUpper(s[1]) { - errs = append(errs, errInvalidFooterUpperCase) - } } } diff --git a/cmd/footer_test.go b/cmd/footer_test.go index bb12917..476b39c 100644 --- a/cmd/footer_test.go +++ b/cmd/footer_test.go @@ -80,26 +80,6 @@ func TestLintFooter(t *testing.T) { } }) - t.Run("invalid capitals", func(t *testing.T) { - trailers := [][]string{ - {"KEY: VALUE"}, - {"KEY: value"}, - {"key: VALUE"}, - } - want := errInvalidFooterUpperCase - - for _, trailer := range trailers { - got := lintFooter(trailer) - if got == nil { - t.Fatal("want error got nil") - } - - if !slices.Contains(got, want) { - t.Fatalf("Trailer: [ %v ], want error: [ %v ], got: %v", trailer, want, got) - } - } - }) - t.Run("invalid keys with spaces", func(t *testing.T) { trailer := []string{"key pair: value"} want := errInvalidFooterSpace