lebedev.ri added a comment.

In https://reviews.llvm.org/D38171#880016, @xazax.hun wrote:

> In https://reviews.llvm.org/D38171#878814, @lebedev.ri wrote:
>
> > I feel like the current handling of the clang-tidy check aliases needs 
> > adjusting.
> >  If one enables all the checks (`Checks: '*'`), and then disables some of 
> > them
> >  on check-by-check basis, if the disabled check has aliases
> >  (`cppcoreguidelines-pro-type-vararg` vs `hicpp-vararg`, 
> > `hicpp-no-array-decay`
> >  vs `cppcoreguidelines-pro-bounds-array-to-pointer-decay` and so on)
> >  each of the aliases must be explicitly be disabled too.
>
>
> That is somewhat intentional I think. Lets imagined you are interested in 
> cppcoreguidelines but not interested in high integrity cpp. It would be great 
> to be able to use Checks: `'cppcoreguidelines*,-hicpp*'` without having to 
> worry about the aliases.
>
> In https://reviews.llvm.org/D38171#878814, @lebedev.ri wrote:
>
> > If that is intentional, perhaps there could be a config option to either 
> > disable
> >  creation/registration of the check aliases altogether, or an option to 
> > threat
> >  aliases as a hard link, so anything happening to any of the aliases/base 
> > check
> >  would happen to all of them.
>
>
> I think the source of the problems is that conceptually there are two 
> distinct reasons to disable a check. One reason when the user is not 
> interested in the results regardless what is the category or name of the 
> check. In this case, all aliases should be disabled. The second is when a 
> category of checks (e.g.: a guideline) is not applicable to the code. In this 
> case aliases should not be disabled. So I think a global option would not 
> solve this issue. A better solution might be a per glob notation. So `-` 
> could mean do not disable aliases and `--` could mean disable aliases as well 
> but that is just an example.
>
> All in all, I think this is not related strictly to this issue and I think we 
> should discuss this separately on the mailing list.
>
> In https://reviews.llvm.org/D38171#878814, @lebedev.ri wrote:
>
> > (Also, if the check has parameters, and one specifies different parameters 
> > for the base check, and the aliases, what happens?)
>
>
> I think this is a very good point, this needs to be documented somewhere.


A mail [0] posted by @JonasToth is about the similar problem, i think we can 
continue there.

I *think* he has a point, a some better way to setup aliases, without actually
creating aliased checks is the solution IMO. This way, there won't be any
need to disable all the aliases when completely disabling the checks, and
there won't be multiple config options for the each alias. The legacy support
is the question though.

[0] (https://lists.llvm.org/pipermail/cfe-dev/2017-September/055589.html)


https://reviews.llvm.org/D38171



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to