[clang-tidy] Suppress google-objc-avoid-throwing-exception in system macros 🫢
authorStephane Moore <stephane.moore@gmail.com>
Wed, 9 Nov 2022 19:07:53 +0000 (11:07 -0800)
committerStephane Moore <stephane.moore@gmail.com>
Thu, 1 Dec 2022 00:44:45 +0000 (16:44 -0800)
commit6c2140943cbe257c85f7121349c5bca950a26e0d
tree50382ef171521b75fb9c36bd42e08ace82298727
parentf7c71611370d3f5f240b080edfce51cd1e4995ce
[clang-tidy] Suppress google-objc-avoid-throwing-exception in system macros ðŸ«¢

The google-objc-avoid-throwing-exception check enforces the Google
Objective-C Style Guide's prohibition on throwing exceptions in user
code but the check incorrectly triggers findings for code emitted from
system headers. This commit suppresses any findings that do not have
valid locations or are emitted from macros in system headers.

Avoid Throwing Exceptions, Google Objective-C Style Guide:
https://github.com/google/styleguide/blob/gh-pages/objcguide.md#avoid-throwing-exceptions

Test Notes:
Ran clang-tidy lit tests.

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D137738
clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/google/Inputs/system-header-throw.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-throwing-exception.m