[PATCH] D75184: [clang-tidy] Optional inheritance of file configs from parent directories 

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 20 01:35:38 PDT 2020


njames93 added a comment.

In D75184#1932764 <https://reviews.llvm.org/D75184#1932764>, @alexfh wrote:

> There's one more thing to consider: just by looking at the name of a local option we don't know whether it will be read using `get()` or `getLocalOrGlobal()`. By removing local options we may introduce an even more surprising behavior than without this special treatment. WDYT?


There's no perfect solution, but in general clang tidy checks use the `getLocalOrGlobal` method when a option is generic. There is a way to implement what you are asking for and that's storing a precedence value with each option when you load the config. Then if you call `getLocalOrGlobal`it will choose the option (local or global) with the highest precedence. That solution would require a little retooling of the options class but could be the best solution


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75184/new/

https://reviews.llvm.org/D75184





More information about the cfe-commits mailing list