From 73c9863d754e43113108d6535ee62edc81cdc684 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 5 Aug 2024 12:16:03 -0700 Subject: [PATCH 1/2] ci: cz: only check PR commits Once something is merged, it does not make sense (and it's too late) to check it. So, limit the check to commits in a given PR. Signed-off-by: Kir Kolyshkin --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ec5167..7192a22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ jobs: run: go test -test.v -race -cover ./... conventional-commits: + if: github.event_name == 'pull_request' # Only check PRs. runs-on: ubuntu-latest steps: @@ -35,5 +36,4 @@ jobs: with: fetch-depth: 0 - run: pip3 install -U Commitizen - # The commit hash here is that of the commit where we started using conventional commits. - - run: cz check --rev-range deebab92..HEAD + - run: cz check --rev-range origin/${{ github.base_ref }}..HEAD From 39f0475f143a7eff54d14f2229c21b48c4446cfc Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 5 Aug 2024 13:17:32 -0700 Subject: [PATCH 2/2] wip test Signed-off-by: Kir Kolyshkin --- errorlint/allowed_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errorlint/allowed_test.go b/errorlint/allowed_test.go index 63d5ee4..dc16140 100644 --- a/errorlint/allowed_test.go +++ b/errorlint/allowed_test.go @@ -45,7 +45,7 @@ func Test_isAllowedErrAndFunc(t *testing.T) { } func Benchmark_isAllowedErrAndFunc(b *testing.B) { - var benchCases = []struct { + benchCases := []struct { desc string err string fun string