Clang-tidy to ignore system headers in macOS

Hi, I’ve started using clang-tidy on my cmake based project.

Unfortunately, this option isn’t supported on Xcode project generation but only in Makefile.

So when I compiled on the first time, one of the error related to a system include line

#import <Foundation/Foundation.h>

here’s the error. Although it seems correct I’d like to ignore it, but couldn’t do so with // NOLINT since it’s header file, So i’ve read about NOLINTBEGIN and NOLINTEND but it’s supported from llvm 14 and Apple has llvm 12.0.1 and I don’t want to update the entire package because it’s used by Xcode

clang-tidy --version
Homebrew LLVM version 12.0.1
  Optimized build.
  Default target: x86_64-apple-darwin20.6.0
  Host CPU: skylake

here’s the error I see :

/Applications/ error: function does not return NSString [clang-diagnostic-error]
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
/Applications/ note: expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
119827 warnings and 1 error generated.
Error while processing /Users/me/proj/
Suppressed 119978 warnings (119822 in non-user code, 5 due to line filter, 151 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
make[2]: *** [CMakeFiles/PASrv.dir/src/] Error 1
make[1]: *** [CMakeFiles/PASrv.dir/all] Error 2

any idea how to ignore this system header ?