Skip to content

Commit

Permalink
Add a lint for SuccessOrExit(CHIP_ERROR_*). (#26057)
Browse files Browse the repository at this point in the history
Since it's not changing state, it's identical to ExitNow(), but it _looks_ like
it's going to somehow return the provided error code.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Sep 29, 2023
1 parent 759bf8d commit 4299449
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4299449

Please sign in to comment.