[clang-tools-extra] [clang-tidy] Support LineFilter in .clang-tidy configuration files (PR #202575)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 27 07:58:07 PDT 2026


vbvictor wrote:

> To be honest, I struggle to envision a scenario where line filter would actually be used in a configuration file. `.clang-tidy` is typically something stored in the repository. Consequently, when modifying code, a developer would have to remember to update the `.clang-tidy` because the line numbers have shifted. It seems far more logical to use `NOLINT` comments. Thus, adding such an option to the config solely to pass it through to clangd doesn't seem entirely worthwhile. Perhaps I'm overlooking some use cases.

It may help in this case:
https://github.com/llvm/llvm-project/issues/59263#issuecomment-3846708515
When you don't specify numbers but only file names. I have to admit that didn't dig enough into it on why other mechanisms don't work (like HeaderFilterRegex which should work..)

https://github.com/llvm/llvm-project/pull/202575


More information about the cfe-commits mailing list