Skip to content

Commit 1d58cad

Browse files
authored
Skip binary files when checking for code patterns in the lint test. (#32102)
1 parent ddf373c commit 1d58cad

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/lint.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -197,23 +197,23 @@ jobs:
197197
- name: Check for incorrect error use in VerifyOrExit
198198
if: always()
199199
run: |
200-
git grep -n "VerifyOrExit(.*, [A-Za-z]*_ERROR" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
200+
git grep -I -n "VerifyOrExit(.*, [A-Za-z]*_ERROR" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
201201
202202
# git grep exits with 0 if it finds a match, but we want
203203
# to fail (exit nonzero) on match. And we want to exclude this file,
204204
# to avoid our grep regexp matching itself.
205205
- name: Check for use of PRI*8, which are not supported on some libcs.
206206
if: always()
207207
run: |
208-
git grep -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
208+
git grep -I -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
209209
210210
# git grep exits with 0 if it finds a match, but we want
211211
# to fail (exit nonzero) on match. And we want to exclude this file,
212212
# to avoid our grep regexp matching itself.
213213
- name: Check for use of PRI*16, which are not supported on some libcs.
214214
if: always()
215215
run: |
216-
git grep -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
216+
git grep -I -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
217217
218218
# git grep exits with 0 if it finds a match, but we want
219219
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -226,7 +226,7 @@ jobs:
226226
# TODO: TLVDebug should ideally not be excluded here.
227227
# TODO: protocol_decoder.cpp should ideally not be excluded here.
228228
# TODO: PersistentStorageMacros.h should ideally not be excluded here.
229-
git grep -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
229+
git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
230230
231231
# git grep exits with 0 if it finds a match, but we want
232232
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -261,15 +261,15 @@ jobs:
261261
- name: Check for use of 0x%u and the like, which lead to misleading output.
262262
if: always()
263263
run: |
264-
git grep -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
264+
git grep -I -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
265265
266266
# git grep exits with 0 if it finds a match, but we want
267267
# to fail (exit nonzero) on match. And we want to exclude this file,
268268
# to avoid our grep regexp matching itself.
269269
- name: Check for use of '"0x" PRIu*' and the like, which lead to misleading output.
270270
if: always()
271271
run: |
272-
git grep -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
272+
git grep -I -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
273273
274274
# git grep exits with 0 if it finds a match, but we want
275275
# to fail (exit nonzero) on match.
@@ -285,7 +285,7 @@ jobs:
285285
- name: Check for use of 'emberAfReadAttribute' instead of the type-safe getters
286286
if: always()
287287
run: |
288-
git grep -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0
288+
git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0
289289
290290
# git grep exits with 0 if it finds a match, but we want
291291
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -295,7 +295,7 @@ jobs:
295295
- name: Check for use of 'emberAfWriteAttribute' instead of the type-safe setters
296296
if: always()
297297
run: |
298-
git grep -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
298+
git grep -I -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
299299
300300
# Run python Linter (flake8) and verify python files
301301
# ignore some style errors, restyler should do that
@@ -310,12 +310,12 @@ jobs:
310310
- name: Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should probably be "SuccessOrExit(err = CHIP_ERROR_*)"
311311
if: always()
312312
run: |
313-
git grep -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
313+
git grep -I -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
314314
315315
# git grep exits with 0 if it finds a match, but we want
316316
# to fail (exit nonzero) on match. And we want to exclude this file,
317317
# to avoid our grep regexp matching itself.
318318
- name: Check for use of "SuccessOrExit(something-without-assignment(", which should probably be "SuccessOrExit(err = something("
319319
if: always()
320320
run: |
321-
git grep -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
321+
git grep -I -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0

0 commit comments

Comments
 (0)