Open seanm opened 4 years ago
Alias' in clang-tidy is a touchy subject.
You should probably disable the cert alias to the bugprone-reserved-identifier check to prevent it running 3 times.
Alias options would mean everytime an aliased check is ran multiple times the options would be the same, therefore you would get double diagnostics(and fix-its) for each issue. Some projects may also like to run checks multiple times with different options which would also break this.
Maybe a specific fix for this check could be having a global options named something like AllowedReservedIdentifiers which could then be read by each of the alias checks
Extended Description
I currently suppress
bugprone-reserved-identifier
false positives by passing this clang-tidy flag:-config="{CheckOptions: [{key: bugprone-reserved-identifier.AllowedIdentifiers, value: _BSD_SOURCE}]}"
That works.
Now the in-progress release notes for clang-tidy 11 say:
Trying now, I get cert-dcl37-c and cert-dcl51-cpp warnings.
Is one really expected to restate the option 3 times for the 3 aliases?
As in:
-config="{CheckOptions: [{key: bugprone-reserved-identifier.AllowedIdentifiers, value: _BSD_SOURCE}, {key: cert-dcl37-c.AllowedIdentifiers, value: _BSD_SOURCE}, {key: cert-dcl51-cpp.AllowedIdentifiers, value: _BSD_SOURCE}]}"
I tried, and it does work. But it would be nice if the options got aliased too.