[PATCH] D15796: [PATCH] clang-tidy documentation redirects

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 28 09:31:22 PST 2015


aaron.ballman created this revision.
aaron.ballman added reviewers: alexfh, sbenza.
aaron.ballman added a subscriber: cfe-commits.

Some of our checkers are registered under multiple different check names. This works well in terms of command line arguments, but does not work well for documentation discoverability. This patch adds documentation for the CERT checks that automatically redirects to the canonical documentation for the checker. It also updates the canonical checkers to have a list of aliases under which the check can be enabled.

Currently, the patch does not add the checkers to list.rst, so they are only discoverable by using the checker name directly. This prevents cluttering up the list of checkers by only listing the canonical ones. However, for the sake of discoverability, we may want to include the duplicated checkers. I wasn't certain which direction we wanted to go, so recommendations are welcome here.

http://reviews.llvm.org/D15796

Files:
  docs/clang-tidy/checks/cert-dcl54-cpp.rst
  docs/clang-tidy/checks/cert-dcl59-cpp.rst
  docs/clang-tidy/checks/cert-err61-cpp.rst
  docs/clang-tidy/checks/cert-oop11-cpp.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/misc-move-constructor-init.rst
  docs/clang-tidy/checks/misc-new-delete-overloads.rst
  docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst

Index: docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst
===================================================================
--- docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst
+++ docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst
@@ -3,6 +3,8 @@
 misc-throw-by-value-catch-by-reference
 ======================================
 
+Aliases: cert-err61-cpp
+
 Finds violations of the rule "Throw by value, catch by reference" presented for example in "C++ Coding Standards" by H. Sutter and A. Alexandrescu. This check also has the option to find violations of the rule "Throw anonymous temporaries" (https://www.securecoding.cert.org/confluence/display/cplusplus/ERR09-CPP.+Throw+anonymous+temporaries). The option is named "CheckThrowTemporaries" and it's on by default.
 
 Exceptions:
Index: docs/clang-tidy/checks/misc-new-delete-overloads.rst
===================================================================
--- docs/clang-tidy/checks/misc-new-delete-overloads.rst
+++ docs/clang-tidy/checks/misc-new-delete-overloads.rst
@@ -3,6 +3,8 @@
 misc-new-delete-overloads
 =========================
 
+Aliases: cert-dcl54-cpp
+
 The check flags overloaded operator new() and operator delete() functions that
 do not have a corresponding free store function defined within the same scope.
 For instance, the check will flag a class implementation of a non-placement
Index: docs/clang-tidy/checks/misc-move-constructor-init.rst
===================================================================
--- docs/clang-tidy/checks/misc-move-constructor-init.rst
+++ docs/clang-tidy/checks/misc-move-constructor-init.rst
@@ -3,6 +3,7 @@
 misc-move-constructor-init
 ==========================
 
+Aliases: cert-oop11-cpp
 
 The check flags user-defined move constructors that have a ctor-initializer
 initializing a member or base class through a copy constructor instead of a
Index: docs/clang-tidy/checks/google-build-namespaces.rst
===================================================================
--- docs/clang-tidy/checks/google-build-namespaces.rst
+++ docs/clang-tidy/checks/google-build-namespaces.rst
@@ -3,6 +3,7 @@
 google-build-namespaces
 =======================
 
+Aliases: cert-dcl59-cpp
 
 Finds anonymous namespaces in headers.
 
Index: docs/clang-tidy/checks/cert-oop11-cpp.rst
===================================================================
--- docs/clang-tidy/checks/cert-oop11-cpp.rst
+++ docs/clang-tidy/checks/cert-oop11-cpp.rst
@@ -0,0 +1,5 @@
+:orphan:
+
+.. title:: clang-tidy - cert-oop11-cpp
+.. meta::
+   :http-equiv=refresh: 0;URL=misc-move-constructor-init.html
Index: docs/clang-tidy/checks/cert-err61-cpp.rst
===================================================================
--- docs/clang-tidy/checks/cert-err61-cpp.rst
+++ docs/clang-tidy/checks/cert-err61-cpp.rst
@@ -0,0 +1,5 @@
+:orphan:
+
+.. title:: clang-tidy - cert-err61-cpp
+.. meta::
+   :http-equiv=refresh: 0;URL=misc-throw-by-value-catch-by-reference.html
Index: docs/clang-tidy/checks/cert-dcl59-cpp.rst
===================================================================
--- docs/clang-tidy/checks/cert-dcl59-cpp.rst
+++ docs/clang-tidy/checks/cert-dcl59-cpp.rst
@@ -0,0 +1,5 @@
+:orphan:
+
+.. title:: clang-tidy - cert-dcl59-cpp
+.. meta::
+   :http-equiv=refresh: 0;URL=google-build-namespaces.html
Index: docs/clang-tidy/checks/cert-dcl54-cpp.rst
===================================================================
--- docs/clang-tidy/checks/cert-dcl54-cpp.rst
+++ docs/clang-tidy/checks/cert-dcl54-cpp.rst
@@ -0,0 +1,5 @@
+:orphan:
+
+.. title:: clang-tidy - cert-dcl54-cpp
+.. meta::
+   :http-equiv=refresh: 0;URL=misc-new-delete-overloads.html


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15796.43696.patch
Type: text/x-patch
Size: 3703 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151228/d76ba978/attachment-0001.bin>


More information about the cfe-commits mailing list