From 5b25d8b5be05f6e81c7db4934f0276ba924e6c05 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 15 Sep 2023 18:35:53 +0700 Subject: [PATCH] ci: fail if any Go files contain an ignore directive (#4055) --- .github/workflows/lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1c74c53b..ee56f6e4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,6 +11,13 @@ jobs: go-version: "1.20.x" - name: Check that no non-test files import Ginkgo or Gomega run: .github/workflows/no_ginkgo.sh + - name: Check for //go:build ignore in .go files + run: | + IGNORED_FILES=$(grep -rl '//go:build ignore' . --include='*.go') || true + if [ -n "$IGNORED_FILES" ]; then + echo "::error::Found ignored Go files: $IGNORED_FILES" + exit 1 + fi - name: Check that go.mod is tidied run: | cp go.mod go.mod.orig