[PATCH] D121372: [clang-tidy][docs][NFC] Update URL and docs of PostfixOperatorCheck

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 23:58:18 PDT 2022


LegalizeAdulthood added inline comments.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:116
    `bugprone-virtual-near-miss <bugprone-virtual-near-miss.html>`_, "Yes"
-   `cert-dcl21-cpp <cert-dcl21-cpp.html>`_,
+   `cert-dcl21-cpp <cert-dcl21-cpp.html>`_, "Yes"
    `cert-dcl50-cpp <cert-dcl50-cpp.html>`_,
----------------
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121372/new/

https://reviews.llvm.org/D121372



More information about the cfe-commits mailing list