Configure clang-tidy rules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Configure clang-tidy rules

Nathan Ridge via cfe-dev
Hello Team,

I want to test the readability-isolate-declaration rule for clang-tidy but the mentioned rule is not enabled.

Command format used to run the rule:
clang-tidy -checks=-* , readability-isolate-declaration

But this gives Error : no checks enabled.

When I tried going through the official documentation of clang-tidy this rule is available. Kindly could some one suggest on how to enable the above mentioned rule.

Regards,
Ravi..



_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Configure clang-tidy rules

Nathan Ridge via cfe-dev
Hi Ravi,

the syntax seems correct, but you want to remove spaces and possibly add quotes to ensure no shell substitutions are taking place.
  clang-tidy -checks='-*,readability-isolate-declaration' /some/dir/foo.cpp
should do the trick.



On Wed, Jun 19, 2019 at 5:45 PM Ravi Koppad via cfe-dev <[hidden email]> wrote:
Hello Team,

I want to test the readability-isolate-declaration rule for clang-tidy but the mentioned rule is not enabled.

Command format used to run the rule:
clang-tidy -checks=-* , readability-isolate-declaration

But this gives Error : no checks enabled.

When I tried going through the official documentation of clang-tidy this rule is available. Kindly could some one suggest on how to enable the above mentioned rule.

Regards,
Ravi..


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


--
Regards,
Ilya Biryukov

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Configure clang-tidy rules

Nathan Ridge via cfe-dev
It is definitely there for the latest build, checked by running:

$ ./bin/clang-tidy -checks='*' -list-checks | grep isolate
    readability-isolate-declaration

Are you using a fresh build of clang-tidy? The check was added in r345735 in October 2018, it's possible that some package managers still have a version built before that revision.

On Fri, Jun 21, 2019 at 11:16 AM Ravi Koppad <[hidden email]> wrote:
Hello lyla,

Good morning.
I tried the suggested way, but it does not work. It gives the same error no checks enabled.

When I tried using command:
clang-tidy -checks=* -list-checks

The required rule is not listed in the rule set. But the document says the rule is available. Could you please let me know how to add the rule to the enabled set.

Regards,
Ravi..

On Wednesday, June 19, 2019, Ilya Biryukov <[hidden email]> wrote:
Hi Ravi,

the syntax seems correct, but you want to remove spaces and possibly add quotes to ensure no shell substitutions are taking place.
  clang-tidy -checks='-*,readability-isolate-declaration' /some/dir/foo.cpp
should do the trick.



On Wed, Jun 19, 2019 at 5:45 PM Ravi Koppad via cfe-dev <[hidden email]> wrote:
Hello Team,

I want to test the readability-isolate-declaration rule for clang-tidy but the mentioned rule is not enabled.

Command format used to run the rule:
clang-tidy -checks=-* , readability-isolate-declaration

But this gives Error : no checks enabled.

When I tried going through the official documentation of clang-tidy this rule is available. Kindly could some one suggest on how to enable the above mentioned rule.

Regards,
Ravi..


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


--
Regards,
Ilya Biryukov


--
Regards,
Ilya Biryukov

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev