diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 17c31b004581d8..9b5de4ac637f40 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -221,3 +221,12 @@ jobs: if: always() run: | flake8 --extend-ignore=E501,W391 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should probably be "SuccessOrExit(err = CHIP_ERROR_*)" + if: always() + run: | + git grep -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 +