Hi,
Is there a way/pattern for a clang-tidy check to require an argument (ie an entry in the .clang-tidy file)?
Looking at the API It has a way for me to storeOptions, but Options.store will always have a Default value.
Tiago
Hi,
Is there a way/pattern for a clang-tidy check to require an argument (ie an entry in the .clang-tidy file)?
Looking at the API It has a way for me to storeOptions, but Options.store will always have a Default value.
Tiago
Hi Tiago,
That support was adding in https://reviews.llvm.org/rGfcf7cc268fe4560bc7cd751494beceff45f5dd10. You can call Options.get("Name")
or Options.get<Inttype>("Name")
and it will return llvm::Expected<...>
.
If there is no option found in the config it will return a MissingOptionError
, If there is an option but it couldnt’t be parsed to the Type it will return a UnparseableIntegerOptionError
. you can just log the Error straight to llvm::errs()
.
Regards,
Nathan James