[cfe-dev] [clang-tidy] Dealing with check names
Piotr Padlewski via cfe-dev
cfe-dev at lists.llvm.org
Mon Dec 12 11:26:19 PST 2016
2016-12-12 17:30 GMT+01:00 Gábor Horváth <xazax.hun at gmail.com>:
>
>
> 2016. dec. 12. du. 5:24 ezt írta ("Piotr Padlewski" <
> piotr.padlewski at gmail.com>):
>
> This sounds also good. I was thinking that it would be nice if clang-tidy
> itself could warn about old name and dump config, but problem here is
> when user have configuration "misc-*" and we moved one check from misc to
> other group. We should probably dump clang-tidy version in the config to
> know how old is config.
>
>
> That is a hairy problem. The reason why I do not like too many aliases,
> because it makes it harder to introduce clang tidy to a project. One have
> to go through more checkers. Also more work to set up the configuration
> files and check for inconsistencies (e.g.: same checker turned on using
> multiple names and inconsistent configuration options).
>
> I understand your problem, but on the other hand I feel that most of the
users don't want to enable whole google/llvm/cert/cppcoreguidelines group.
Instead they want to pick "performance" or "readability" or "modernize".
Example:
-
- These checks could be moved into readability
llvm-header-guard
<http://clang.llvm.org/extra/clang-tidy/checks/llvm-header-guard.html>
- llvm-include-order
<http://clang.llvm.org/extra/clang-tidy/checks/llvm-include-order.html>
- llvm-namespace-comment
<http://clang.llvm.org/extra/clang-tidy/checks/llvm-namespace-comment.html>
-
- This one could be general and take type name to look for - so we
would have a link with configuration)
- llvm-twine-local
<http://clang.llvm.org/extra/clang-tidy/checks/llvm-twine-local.html>
If clang-tidy would be smart enough to figure out that you are using the
same check multiple times (e.g. after moving llvm checks to readability
with -checks="llvm-*,readability-*") and merge your configuration somehow
so you would run check only one time.
If your configuration for both links is the same then it is obvious. If
configuration would be different then
a) there is bug in configuration and user have to pick only one option
b) options have to be merged to look for more things (e.g. llvm-twine-local
would look for stack variable with type "twine" and
orgname-different_type-local would look for type "different_type". Both
would use the same check so we could just merge and look for
"twine;different_type"
Piotr
>
> 2016-12-12 16:17 GMT+01:00 Gábor Horváth <xazax.hun at gmail.com>:
>
>> Hi!
>>
>> What about an alternative solution, like changing the names and providing
>> a python script to migrate the configuration files?
>>
>> Regards,
>> Gábor
>>
>> On 12 December 2016 at 16:02, Piotr Padlewski via cfe-dev <
>> cfe-dev at lists.llvm.org> wrote:
>>
>>> Hi,
>>> as clang-tidy grows there are more and more checks. One of the problem I
>>> see is that "misc" check group is not user friendly - there are many checks
>>> that do so many different things that usually user don't want to enable
>>> whole group.
>>> Other groups like modernize, performance, google, cert, boost, llvm
>>> doesn't have this problem. Naturally the solution would be to split the
>>> group into smaller groups that would mean more.
>>> The problem is that we should not change names because old configs will
>>> not work.
>>>
>>> Do you have some ideas how we could fix it, so we could make it easier
>>> for users to use it?
>>>
>>> Other feature that we could add if we would know how to solve it is that
>>> we could make new groups that would mostly have aliases to other checks.
>>> This might be specially useful for cert checks - the cert code names
>>> doesn't tell anything, so it would be good to have these checks with proper
>>> name in different group so normal user could see what this check is doing
>>> from name and CERT users could run checks with cert group as it was before.
>>>
>>>
>>> One solution that I see is to reserve old name and make redirection, and
>>> maybe output warning about deprecated name when user would use special flag
>>> (e.g. verbose)
>>>
>>> What do you think about this problem?
>>>
>>> Piotr
>>>
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>>
>>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161212/ace80399/attachment.html>
More information about the cfe-dev
mailing list