This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy][docs][NFC] Update URL and docs of PostfixOperatorCheck
ClosedPublic

Authored by steakhal on Mar 10 2022, 4:14 AM.

Details

Summary

The docs URL was dangling, and the docs suggested that it has no fixits, but it actually had.

Diff Detail

Event Timeline

steakhal created this revision.Mar 10 2022, 4:14 AM
steakhal requested review of this revision.Mar 10 2022, 4:14 AM
This revision is now accepted and ready to land.Mar 11 2022, 12:23 PM
clang-tools-extra/docs/clang-tidy/checks/list.rst
116

The problem with making this change manually in the list.rst is that the next time someone runs add_new_check.py, the change will get lost again unless someone reviews the diff carefully and reverts the unwanted change. These manual reversions continue to accumulate and the chances for error increase with each run of add_new_check.py.

This is additionally complicated by the fact that the check name doesn't correspond algorithmically to the source file that implements the check, which is how add_new_check.py figures out whether or not a check implements fixits to add "Yes" for this column in the generated list.rst.

Here are some options I can see (there may be others, discussion welcome):

  • Make the "official" check name cert-postfix-operator and add cert-dcl121-cpp an alias? This would enable the logic in add_new_check.py to correctly match up the source file for the check to the check name.
  • Rename the source file to Dcl121CppCheck.cpp, but I don't think that's as self-documenting as the existing file name.
  • Have add_new_check.py consult the xxxModule.cpp files and scrape out matching check names to check class names and use the class name to scrape source files, possibly only when the corresponding source file that matches the check name doesn't exist.

We should also add comments to list.rst to indicate that the file is processed by a script.

116

Also, sorry for bringing this up much later.. I noticed it because I'm testing some other changes to add_new_check.py and it was reverting the change made here manually.