siderolabs/conform

crash with coventional commits like `chore(ci)`

smira opened this issue · 2 comments

smira commented

chore works, but chore(anything) crashes

021/02/17 20:30:48 writing /tmp/conform070822999/github/event.json to disk
panic: regexp: Compile(`*`): error parsing regexp: missing argument to repetition operator: `*`
goroutine 1 [running]:
regexp.MustCompile(0x133c0aa, 0x1, 0x0)
	/usr/local/go/src/regexp/regexp.go:311 +0x152
github.com/talos-systems/conform/internal/policy/commit.Commit.ValidateConventionalCommit(0xc00046c160, 0xc000c8cf00, 0xc0005cfe90, 0xc0009313d8, 0x10001, 0xc0001b5ea0, 0x9c, 0x8, 0xc00215fa00)
	/conform/internal/policy/commit/check_conventional_commit.go:92 +0x1b5
github.com/talos-systems/conform/internal/policy/commit.(*Commit).Compliance(0xc00020f4c0, 0xc000373500, 0xca9e40, 0xc00020f4c0, 0x0)
	/conform/internal/policy/commit/commit.go:121 +0x733
github.com/talos-systems/conform/internal/enforcer.(*Conform).enforce(0xc0001d9b60, 0xc0003731c0, 0xc000373500, 0x1, 0x1, 0x1d)
	/conform/internal/enforcer/enforcer.go:133 +0x182
github.com/talos-systems/conform/internal/enforcer.(*Conform).Enforce(0xc0001d9b60, 0xc0006ac778, 0x1, 0x1, 0x1, 0xc0006ac778)
	/conform/internal/enforcer/enforcer.go:85 +0x1c4
github.com/talos-systems/conform/cmd.glob..func1(0x17c8b80, 0xc000290860, 0x0, 0x2, 0x0, 0x0)
	/conform/cmd/enforce.go:45 +0x33f
github.com/spf13/cobra.(*Command).execute(0x17c8b80, 0xc000290840, 0x2, 0x2, 0x17c8b80, 0xc000290840)
	/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x453
github.com/spf13/cobra.(*Command).ExecuteC(0x17c8de0, 0x0, 0x0, 0x0)
	/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
github.com/talos-systems/conform/cmd.Execute()
	/conform/cmd/root.go:24 +0x2d
main.main()
	/conform/main.go:10 +0x20
2021/02/17 20:30:49 command failed: exit status 2

I tested this on one of my repos and it did not crash for me.

smira commented

so the problem was to use correct regexp, * should be changed to .*