Skip to content

Commit c076bce

Browse files
PiotrZSLyuxuanchen1997
authored andcommitted
[clang-tidy][DOC] Update check documentation
Summary: Fix issues in list.rst, addapt add_new_check.py to new format of that file, and run gen-static-analyzer-docs.py to generate missing documentation for clang-analyzer. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251068
1 parent b280d71 commit c076bce

File tree

6 files changed

+52
-7
lines changed

6 files changed

+52
-7
lines changed

clang-tools-extra/clang-tidy/add_new_check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ def format_link_alias(doc_file):
552552
f.write(' :header: "Name", "Offers fixes"\n\n')
553553
f.writelines(checks)
554554
# and the aliases
555-
f.write("\n\n")
556-
f.write(".. csv-table:: Aliases..\n")
555+
f.write("\nCheck aliases\n-------------\n\n")
556+
f.write(".. csv-table::\n")
557557
f.write(' :header: "Name", "Redirect", "Offers fixes"\n\n')
558558
f.writelines(checks_alias)
559559
break
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
.. title:: clang-tidy - clang-analyzer-cplusplus.Move
2+
.. meta::
3+
:http-equiv=refresh: 5;URL=https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-move
24

35
clang-analyzer-cplusplus.Move
46
=============================
57

68
Find use-after-move bugs in C++.
79

8-
The clang-analyzer-cplusplus.Move check is an alias of
9-
Clang Static Analyzer cplusplus.Move.
10+
The `clang-analyzer-cplusplus.Move` check is an alias, please see
11+
`Clang Static Analyzer Available Checkers
12+
<https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-move>`_
13+
for more information.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. title:: clang-tidy - clang-analyzer-optin.taint.TaintedAlloc
2+
.. meta::
3+
:http-equiv=refresh: 5;URL=https://clang.llvm.org/docs/analyzer/checkers.html#optin-taint-taintedalloc
4+
5+
clang-analyzer-optin.taint.TaintedAlloc
6+
=======================================
7+
8+
Check for memory allocations, where the size parameter might be a tainted
9+
(attacker controlled) value.
10+
11+
The `clang-analyzer-optin.taint.TaintedAlloc` check is an alias, please see
12+
`Clang Static Analyzer Available Checkers
13+
<https://clang.llvm.org/docs/analyzer/checkers.html#optin-taint-taintedalloc>`_
14+
for more information.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. title:: clang-tidy - clang-analyzer-security.PutenvStackArray
2+
3+
clang-analyzer-security.PutenvStackArray
4+
========================================
5+
6+
Finds calls to the function 'putenv' which pass a pointer to an automatic
7+
(stack-allocated) array as the argument.
8+
9+
The clang-analyzer-security.PutenvStackArray check is an alias of
10+
Clang Static Analyzer security.PutenvStackArray.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. title:: clang-tidy - clang-analyzer-unix.BlockInCriticalSection
2+
.. meta::
3+
:http-equiv=refresh: 5;URL=https://clang.llvm.org/docs/analyzer/checkers.html#unix-blockincriticalsection
4+
5+
clang-analyzer-unix.BlockInCriticalSection
6+
==========================================
7+
8+
Check for calls to blocking functions inside a critical section.
9+
10+
The `clang-analyzer-unix.BlockInCriticalSection` check is an alias, please see
11+
`Clang Static Analyzer Available Checkers
12+
<https://clang.llvm.org/docs/analyzer/checkers.html#unix-blockincriticalsection>`_
13+
for more information.

clang-tools-extra/docs/clang-tidy/checks/list.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Clang-Tidy Checks
118118
:doc:`bugprone-not-null-terminated-result <bugprone/not-null-terminated-result>`, "Yes"
119119
:doc:`bugprone-optional-value-conversion <bugprone/optional-value-conversion>`, "Yes"
120120
:doc:`bugprone-parent-virtual-call <bugprone/parent-virtual-call>`, "Yes"
121+
:doc:`bugprone-pointer-arithmetic-on-polymorphic-object <bugprone/pointer-arithmetic-on-polymorphic-object>`,
121122
:doc:`bugprone-posix-return <bugprone/posix-return>`, "Yes"
122123
:doc:`bugprone-redundant-branch-condition <bugprone/redundant-branch-condition>`, "Yes"
123124
:doc:`bugprone-reserved-identifier <bugprone/reserved-identifier>`, "Yes"
@@ -158,7 +159,6 @@ Clang-Tidy Checks
158159
:doc:`bugprone-unused-raii <bugprone/unused-raii>`, "Yes"
159160
:doc:`bugprone-unused-return-value <bugprone/unused-return-value>`,
160161
:doc:`bugprone-use-after-move <bugprone/use-after-move>`,
161-
:doc:`bugprone-pointer-arithmetic-on-polymorphic-object <bugprone/pointer-arithmetic-on-polymorphic-object>`,
162162
:doc:`bugprone-virtual-near-miss <bugprone/virtual-near-miss>`, "Yes"
163163
:doc:`cert-dcl50-cpp <cert/dcl50-cpp>`,
164164
:doc:`cert-dcl58-cpp <cert/dcl58-cpp>`,
@@ -269,7 +269,7 @@ Clang-Tidy Checks
269269
:doc:`misc-unused-parameters <misc/unused-parameters>`, "Yes"
270270
:doc:`misc-unused-using-decls <misc/unused-using-decls>`, "Yes"
271271
:doc:`misc-use-anonymous-namespace <misc/use-anonymous-namespace>`,
272-
:doc:`misc-use-internal-linkage <misc/use-internal-linkage>`,
272+
:doc:`misc-use-internal-linkage <misc/use-internal-linkage>`, "Yes"
273273
:doc:`modernize-avoid-bind <modernize/avoid-bind>`, "Yes"
274274
:doc:`modernize-avoid-c-arrays <modernize/avoid-c-arrays>`,
275275
:doc:`modernize-concat-nested-namespaces <modernize/concat-nested-namespaces>`, "Yes"
@@ -409,6 +409,7 @@ Check aliases
409409
:doc:`bugprone-narrowing-conversions <bugprone/narrowing-conversions>`, :doc:`cppcoreguidelines-narrowing-conversions <cppcoreguidelines/narrowing-conversions>`,
410410
:doc:`cert-con36-c <cert/con36-c>`, :doc:`bugprone-spuriously-wake-up-functions <bugprone/spuriously-wake-up-functions>`,
411411
:doc:`cert-con54-cpp <cert/con54-cpp>`, :doc:`bugprone-spuriously-wake-up-functions <bugprone/spuriously-wake-up-functions>`,
412+
:doc:`cert-ctr56-cpp <cert/ctr56-cpp>`, :doc:`bugprone-pointer-arithmetic-on-polymorphic-object <bugprone/pointer-arithmetic-on-polymorphic-object>`,
412413
:doc:`cert-dcl03-c <cert/dcl03-c>`, :doc:`misc-static-assert <misc/static-assert>`, "Yes"
413414
:doc:`cert-dcl16-c <cert/dcl16-c>`, :doc:`readability-uppercase-literal-suffix <readability/uppercase-literal-suffix>`, "Yes"
414415
:doc:`cert-dcl37-c <cert/dcl37-c>`, :doc:`bugprone-reserved-identifier <bugprone/reserved-identifier>`, "Yes"
@@ -448,7 +449,7 @@ Check aliases
448449
:doc:`clang-analyzer-core.uninitialized.UndefReturn <clang-analyzer/core.uninitialized.UndefReturn>`, `Clang Static Analyzer core.uninitialized.UndefReturn <https://clang.llvm.org/docs/analyzer/checkers.html#core-uninitialized-undefreturn>`_,
449450
:doc:`clang-analyzer-cplusplus.ArrayDelete <clang-analyzer/cplusplus.ArrayDelete>`, `Clang Static Analyzer cplusplus.ArrayDelete <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-arraydelete>`_,
450451
:doc:`clang-analyzer-cplusplus.InnerPointer <clang-analyzer/cplusplus.InnerPointer>`, `Clang Static Analyzer cplusplus.InnerPointer <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-innerpointer>`_,
451-
:doc:`clang-analyzer-cplusplus.Move <clang-analyzer/cplusplus.Move>`, Clang Static Analyzer cplusplus.Move,
452+
:doc:`clang-analyzer-cplusplus.Move <clang-analyzer/cplusplus.Move>`, `Clang Static Analyzer cplusplus.Move <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-move>`_,
452453
:doc:`clang-analyzer-cplusplus.NewDelete <clang-analyzer/cplusplus.NewDelete>`, `Clang Static Analyzer cplusplus.NewDelete <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-newdelete>`_,
453454
:doc:`clang-analyzer-cplusplus.NewDeleteLeaks <clang-analyzer/cplusplus.NewDeleteLeaks>`, `Clang Static Analyzer cplusplus.NewDeleteLeaks <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-newdeleteleaks>`_,
454455
:doc:`clang-analyzer-cplusplus.PlacementNew <clang-analyzer/cplusplus.PlacementNew>`, `Clang Static Analyzer cplusplus.PlacementNew <https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-placementnew>`_,
@@ -471,6 +472,7 @@ Check aliases
471472
:doc:`clang-analyzer-optin.performance.GCDAntipattern <clang-analyzer/optin.performance.GCDAntipattern>`, `Clang Static Analyzer optin.performance.GCDAntipattern <https://clang.llvm.org/docs/analyzer/checkers.html#optin-performance-gcdantipattern>`_,
472473
:doc:`clang-analyzer-optin.performance.Padding <clang-analyzer/optin.performance.Padding>`, `Clang Static Analyzer optin.performance.Padding <https://clang.llvm.org/docs/analyzer/checkers.html#optin-performance-padding>`_,
473474
:doc:`clang-analyzer-optin.portability.UnixAPI <clang-analyzer/optin.portability.UnixAPI>`, `Clang Static Analyzer optin.portability.UnixAPI <https://clang.llvm.org/docs/analyzer/checkers.html#optin-portability-unixapi>`_,
475+
:doc:`clang-analyzer-optin.taint.TaintedAlloc <clang-analyzer/optin.taint.TaintedAlloc>`, `Clang Static Analyzer optin.taint.TaintedAlloc <https://clang.llvm.org/docs/analyzer/checkers.html#optin-taint-taintedalloc>`_,
474476
:doc:`clang-analyzer-osx.API <clang-analyzer/osx.API>`, `Clang Static Analyzer osx.API <https://clang.llvm.org/docs/analyzer/checkers.html#osx-api>`_,
475477
:doc:`clang-analyzer-osx.MIG <clang-analyzer/osx.MIG>`, Clang Static Analyzer osx.MIG,
476478
:doc:`clang-analyzer-osx.NumberObjectConversion <clang-analyzer/osx.NumberObjectConversion>`, `Clang Static Analyzer osx.NumberObjectConversion <https://clang.llvm.org/docs/analyzer/checkers.html#osx-numberobjectconversion>`_,
@@ -501,6 +503,7 @@ Check aliases
501503
:doc:`clang-analyzer-osx.coreFoundation.containers.OutOfBounds <clang-analyzer/osx.coreFoundation.containers.OutOfBounds>`, `Clang Static Analyzer osx.coreFoundation.containers.OutOfBounds <https://clang.llvm.org/docs/analyzer/checkers.html#osx-corefoundation-containers-outofbounds>`_,
502504
:doc:`clang-analyzer-osx.coreFoundation.containers.PointerSizedValues <clang-analyzer/osx.coreFoundation.containers.PointerSizedValues>`, `Clang Static Analyzer osx.coreFoundation.containers.PointerSizedValues <https://clang.llvm.org/docs/analyzer/checkers.html#osx-corefoundation-containers-pointersizedvalues>`_,
503505
:doc:`clang-analyzer-security.FloatLoopCounter <clang-analyzer/security.FloatLoopCounter>`, `Clang Static Analyzer security.FloatLoopCounter <https://clang.llvm.org/docs/analyzer/checkers.html#security-floatloopcounter>`_,
506+
:doc:`clang-analyzer-security.PutenvStackArray <clang-analyzer/security.PutenvStackArray>`, Clang Static Analyzer security.PutenvStackArray,
504507
:doc:`clang-analyzer-security.SetgidSetuidOrder <clang-analyzer/security.SetgidSetuidOrder>`, Clang Static Analyzer security.SetgidSetuidOrder,
505508
:doc:`clang-analyzer-security.cert.env.InvalidPtr <clang-analyzer/security.cert.env.InvalidPtr>`, `Clang Static Analyzer security.cert.env.InvalidPtr <https://clang.llvm.org/docs/analyzer/checkers.html#security-cert-env-invalidptr>`_,
506509
:doc:`clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling <clang-analyzer/security.insecureAPI.DeprecatedOrUnsafeBufferHandling>`, `Clang Static Analyzer security.insecureAPI.DeprecatedOrUnsafeBufferHandling <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-deprecatedorunsafebufferhandling>`_,
@@ -517,6 +520,7 @@ Check aliases
517520
:doc:`clang-analyzer-security.insecureAPI.strcpy <clang-analyzer/security.insecureAPI.strcpy>`, `Clang Static Analyzer security.insecureAPI.strcpy <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-strcpy>`_,
518521
:doc:`clang-analyzer-security.insecureAPI.vfork <clang-analyzer/security.insecureAPI.vfork>`, `Clang Static Analyzer security.insecureAPI.vfork <https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-vfork>`_,
519522
:doc:`clang-analyzer-unix.API <clang-analyzer/unix.API>`, `Clang Static Analyzer unix.API <https://clang.llvm.org/docs/analyzer/checkers.html#unix-api>`_,
523+
:doc:`clang-analyzer-unix.BlockInCriticalSection <clang-analyzer/unix.BlockInCriticalSection>`, `Clang Static Analyzer unix.BlockInCriticalSection <https://clang.llvm.org/docs/analyzer/checkers.html#unix-blockincriticalsection>`_,
520524
:doc:`clang-analyzer-unix.Errno <clang-analyzer/unix.Errno>`, `Clang Static Analyzer unix.Errno <https://clang.llvm.org/docs/analyzer/checkers.html#unix-errno>`_,
521525
:doc:`clang-analyzer-unix.Malloc <clang-analyzer/unix.Malloc>`, `Clang Static Analyzer unix.Malloc <https://clang.llvm.org/docs/analyzer/checkers.html#unix-malloc>`_,
522526
:doc:`clang-analyzer-unix.MallocSizeof <clang-analyzer/unix.MallocSizeof>`, `Clang Static Analyzer unix.MallocSizeof <https://clang.llvm.org/docs/analyzer/checkers.html#unix-mallocsizeof>`_,

0 commit comments

Comments
 (0)