pre-commit accepts exclude keys which take pythonregular expressions, typically designed with regex101. For example: 1exclude:| 2 (?x)( 3 thirdparty| # vendored 4 xtb.h| # vendored 5 ) 6- id:clang-format 7name:clang-format 8entry:clang-format 9language:system10types_or:[c, c++, cuda]11args:["-fallback-style=none","-style=file","-i"] While it is especially useful for tools which don’t have ignore flags, as a convention: