在 clang-tidy 配置中没有等效的“-line-filter”?

ren*_*tze 7 clang-tidy

我想-line-filter=.clang-tidy文件中配置我的参数,而不是在生成命令的 cmake 源文件中。向LineFilter文件添加密钥只会让我出现“未知密钥”错误。这真的不通过配置文件支持吗?有其他选择吗?

pab*_*285 3

不幸的是,这不受支持,请参阅ClangTidyOptions.h的源代码

/// Global options. These options are neither stored nor read from
 /// configuration files.
 struct ClangTidyGlobalOptions {
   /// Output warnings from certain line ranges of certain files only.
   /// If empty, no warnings will be filtered.
   std::vector<FileFilter> LineFilter;
 };
Run Code Online (Sandbox Code Playgroud)