[clang-tools-extra] [clang-tidy] add depercation warning for non-whitelisted global options (PR #121057)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 28 07:10:01 PST 2024
5chmidti wrote:
> Good point, maybe we can use more smart way to do warning: only warn the global option is set but local option is not.
>
> Have some redundant options is not the aim for this deprecation things, we only want to avoid user suddenly find the behaviors of lots of check are changed. So we only need to warn for config which rely on global option and no local option.
Your implementation of this looks good.
> I wonder however how it will work for people who are stuck in old clang-tidy files for whatever reason - this warning can be very noisy if running clang-tidy in CI with lots of files. Do we need some CLI option to allow users to silence the warnings?
Adding a flag would either entail deprecating it again, or deciding that it is kept for future deprecations (and would therefore need to be general enough). Maybe something like `--[quiet/no]-config-warnings`? There are 11 `StrictMode` options, and 21 `IgnoreMacros` options, so there could be potentially 32 warnings for each checked file of a project, which is a lot. IMO, we don't *need* a flag, but it would make for a better user experience.
On the other hand, configs could be easily adjusted. Unless someone is in the position that you've described, that they have no control over the `.clang-tidy` file. While most projects would probably welcome those changes, some users may just want things to work without drowning in config warnings, and so they may prefer having the flag.
https://github.com/llvm/llvm-project/pull/121057
More information about the cfe-commits
mailing list