This is an archive of the discontinued LLVM Phabricator instance.

clang-tidy: add IgnoreMacros option to readability-inconsistent-declaration-parameter-name
ClosedPublic

Authored by vmiklos on Jan 3 2018, 2:09 PM.

Details

Summary
And also enable it by default to be consistent with e.g. modernize-use-using.

This helps e.g. when running this check on client code where the macro is
provided by the system, so there is no easy way to modify it.

Diff Detail

Repository
rL LLVM

Event Timeline

vmiklos created this revision.Jan 3 2018, 2:09 PM

And also enable it by default to be consistent with e.g. modernize-use-using.

That changes the defaults though. I thought clang-tidy *tried* to produce the same results
on different clang-tidy versions with the same .clang-tidy config? Or is there no such guarantees?

That changes the defaults though. I thought clang-tidy *tried* to produce the same results
on different clang-tidy versions with the same .clang-tidy config? Or is there no such guarantees?

Hmm, I see this as a trade-off between backwards compatibility and consistency. Here I went for consistency, so that all of readability-inconsistent-declaration-parameter-name, modernize-use-default-member-init and modernize-use-using default to IgnoreMacros=1. But I don't have a too strong opinion on that, can change the default to 0 if really wanted,

alexfh added a comment.Jan 5 2018, 6:22 AM

That changes the defaults though. I thought clang-tidy *tried* to produce the same results
on different clang-tidy versions with the same .clang-tidy config? Or is there no such guarantees?

Hmm, I see this as a trade-off between backwards compatibility and consistency. Here I went for consistency, so that all of readability-inconsistent-declaration-parameter-name, modernize-use-default-member-init and modernize-use-using default to IgnoreMacros=1. But I don't have a too strong opinion on that, can change the default to 0 if really wanted,

I'd personally prefer consistency in this case, especially because the option can be specified globally for all checks.

alexfh accepted this revision.Jan 5 2018, 6:23 AM

Thus, looks good. Thanks!

This revision is now accepted and ready to land.Jan 5 2018, 6:23 AM
This revision was automatically updated to reflect the committed changes.