This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Correct typo in bugprone-easily-swappable-parameters
ClosedPublic

Authored by salman-javed-nz on Oct 26 2021, 11:49 PM.

Details

Summary

The string table DefaultIgnoredParameterTypeSuffixes has a typo:
ForwardIt is mistyped as FowardIt.

Correct typo and add test coverage.

Diff Detail

Event Timeline

salman-javed-nz requested review of this revision.Oct 26 2021, 11:49 PM
salman-javed-nz added a comment.EditedOct 26 2021, 11:54 PM

Pretty sure this is a typo. Curiously the unit tests did not pick it up.
I have taken the liberty to add a unit test to lock down the correct spellings.

100% typo. 😂 Aww 'chute... Bunch of rebases.
Yeah I didn't add extensive tests for simply the configuration, only for the configurations working.

Did you check the documentation file? It should mention the default values for the checker configuration options. Does it say ForwardIt there properly?

The documentation looks correct.
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-easily-swappable-parameters.html

By default, the following, and their lowercase-initial variants are ignored: bool, It, Iterator, InputIt, ForwardIt, BidirIt, RandomIt, random_iterator, ReverseIt, reverse_iterator, reverse_const_iterator, RandomIt, random_iterator, ReverseIt, reverse_iterator, reverse_const_iterator, Const_Iterator, ConstIterator, const_reverse_iterator, ConstReverseIterator. In addition, _Bool (but not _bool) is also part of the default value.

whisperity accepted this revision.Oct 27 2021, 2:21 AM

Perfect! Have you obtained commit rights already, or should I go ahead and commit this?

This revision is now accepted and ready to land.Oct 27 2021, 2:21 AM

I have just received commit access, and this will be my first patch that I can commit on my own.
I'll be in touch if I run into committing issues. Thanks for the review!