Skip to content

Commit a7ba8dc

Browse files
authored
[clang-tidy][docs][NFC] Enforce 80 characters limit (4/4) (#168049)
Fix documentation in `mpi`, `objc`, `openmp`, `performance`, `portability`, `readability` and `zircon`. This is part of the codebase cleanup described in #167098
1 parent ad31e11 commit a7ba8dc

33 files changed

+363
-222
lines changed

clang-tools-extra/docs/clang-tidy/checks/mpi/buffer-deref.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ mpi-buffer-deref
55

66
This check verifies if a buffer passed to an MPI (Message Passing Interface)
77
function is sufficiently dereferenced. Buffers should be passed as a single
8-
pointer or array. As MPI function signatures specify ``void *`` for their buffer
9-
types, insufficiently dereferenced buffers can be passed, like for example as
10-
double pointers or multidimensional arrays, without a compiler warning emitted.
8+
pointer or array. As MPI function signatures specify ``void *`` for their
9+
buffer types, insufficiently dereferenced buffers can be passed, like for
10+
example as double pointers or multidimensional arrays, without a compiler
11+
warning emitted.
1112

1213
Examples:
1314

clang-tools-extra/docs/clang-tidy/checks/mpi/type-mismatch.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
mpi-type-mismatch
44
=================
55

6-
This check verifies if buffer type and MPI (Message Passing Interface) datatype
7-
pairs match for used MPI functions. All MPI datatypes defined by the MPI
8-
standard (3.1) are verified by this check. User defined typedefs, custom MPI
9-
datatypes and null pointer constants are skipped, in the course of verification.
6+
This check verifies if buffer type and MPI (Message Passing Interface)
7+
datatype pairs match for used MPI functions. All MPI datatypes defined
8+
by the MPI standard (3.1) are verified by this check. User defined typedefs,
9+
custom MPI datatypes and null pointer constants are skipped, in the course
10+
of verification.
1011

1112
Example:
1213

clang-tools-extra/docs/clang-tidy/checks/objc/forbidden-subclassing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
objc-forbidden-subclassing
44
==========================
55

6-
Finds Objective-C classes which are subclasses of classes which are not designed
7-
to be subclassed.
6+
Finds Objective-C classes which are subclasses of classes which are
7+
not designed to be subclassed.
88

9-
By default, includes a list of Objective-C classes which are publicly documented
10-
as not supporting subclassing.
9+
By default, includes a list of Objective-C classes which are publicly
10+
documented as not supporting subclassing.
1111

1212
.. note::
1313

clang-tools-extra/docs/clang-tidy/checks/objc/nsdate-formatter.rst

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,71 +3,93 @@
33
objc-nsdate-formatter
44
=====================
55

6-
When ``NSDateFormatter`` is used to convert an ``NSDate`` type to a ``String`` type, the user
7-
can specify a custom format string. Certain format specifiers are undesirable
8-
despite being legal. See http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns for all legal date patterns.
6+
When ``NSDateFormatter`` is used to convert an ``NSDate`` type to a ``String``
7+
type, the user can specify a custom format string. Certain format specifiers
8+
are undesirable despite being legal.
9+
See http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns
10+
for all legal date patterns.
911

10-
This checker reports as warnings the following string patterns in a date format specifier:
12+
This checker reports as warnings the following string patterns in a date
13+
format specifier:
1114

12-
#. yyyy + ww : Calendar year specified with week of a week year (unless YYYY is also specified).
15+
#. yyyy + ww : Calendar year specified with week of a week year
16+
(unless YYYY is also specified).
1317

14-
* | **Example 1:** Input Date: `29 December 2014` ; Format String: `yyyy-ww`;
18+
* | **Example 1:** Input Date: `29 December 2014` ;
19+
| Format String: `yyyy-ww`;
1520
| Output string: `2014-01` (Wrong because it’s not the first week of 2014)
1621
17-
* | **Example 2:** Input Date: `29 December 2014` ; Format String: `dd-MM-yyyy (ww-YYYY)`;
22+
* | **Example 2:** Input Date: `29 December 2014` ;
23+
| Format String: `dd-MM-yyyy (ww-YYYY)`;
1824
| Output string: `29-12-2014 (01-2015)` (This is correct)
1925
2026
#. F without ee/EE : Numeric day of week in a month without actual day.
2127

2228
* | **Example:** Input Date: `29 December 2014` ; Format String: `F-MM`;
23-
| Output string: `5-12` (Wrong because it reads as *5th ___ of Dec* in English)
29+
| Output string: `5-12` (Wrong because it reads as *5th ___ of Dec* in
30+
| English)
2431
2532
#. F without MM : Numeric day of week in a month without month.
2633

2734
* | **Example:** Input Date: `29 December 2014` ; Format String: `F-EE`
28-
| Output string: `5-Mon` (Wrong because it reads as *5th Mon of ___* in English)
35+
| Output string: `5-Mon` (Wrong because it reads as *5th Mon of ___* in
36+
| English)
2937
3038
#. WW without MM : Week of the month without the month.
3139

3240
* | **Example:** Input Date: `29 December 2014` ; Format String: `WW-yyyy`
33-
| Output string: `05-2014` (Wrong because it reads as *5th Week of ___* in English)
41+
| Output string: `05-2014` (Wrong because it reads as *5th Week of ___* in
42+
| English)
3443
35-
#. YYYY + QQ : Week year specified with quarter of normal year (unless yyyy is also specified).
44+
#. YYYY + QQ : Week year specified with quarter of normal year
45+
(unless yyyy is also specified).
3646

3747
* | **Example 1:** Input Date: `29 December 2014` ; Format String: `YYYY-QQ`
38-
| Output string: `2015-04` (Wrong because it’s not the 4th quarter of 2015)
48+
| Output string: `2015-04` (Wrong because it’s not the 4th quarter of
49+
| 2015)
3950
40-
* | **Example 2:** Input Date: `29 December 2014` ; Format String: `ww-YYYY (QQ-yyyy)`
51+
* | **Example 2:** Input Date: `29 December 2014` ;
52+
| Format String: `ww-YYYY (QQ-yyyy)`
4153
| Output string: `01-2015 (04-2014)` (This is correct)
4254
43-
#. YYYY + MM : Week year specified with Month of a calendar year (unless yyyy is also specified).
55+
#. YYYY + MM : Week year specified with Month of a calendar year
56+
(unless yyyy is also specified).
4457

4558
* | **Example 1:** Input Date: `29 December 2014` ; Format String: `YYYY-MM`
4659
| Output string: `2015-12` (Wrong because it’s not the 12th month of 2015)
4760
48-
* | **Example 2:** Input Date: `29 December 2014` ; Format String: `ww-YYYY (MM-yyyy)`
61+
* | **Example 2:** Input Date: `29 December 2014` ;
62+
| Format String: `ww-YYYY (MM-yyyy)`
4963
| Output string: `01-2015 (12-2014)` (This is correct)
5064
51-
#. YYYY + DD : Week year with day of a calendar year (unless yyyy is also specified).
65+
#. YYYY + DD : Week year with day of a calendar year
66+
(unless yyyy is also specified).
5267

5368
* | **Example 1:** Input Date: `29 December 2014` ; Format String: `YYYY-DD`
5469
| Output string: `2015-363` (Wrong because it’s not the 363rd day of 2015)
5570
56-
* | **Example 2:** Input Date: `29 December 2014` ; Format String: `ww-YYYY (DD-yyyy)`
71+
* | **Example 2:** Input Date: `29 December 2014` ;
72+
| Format String: `ww-YYYY (DD-yyyy)`
5773
| Output string: `01-2015 (363-2014)` (This is correct)
5874
59-
#. YYYY + WW : Week year with week of a calendar year (unless yyyy is also specified).
75+
#. YYYY + WW : Week year with week of a calendar year
76+
(unless yyyy is also specified).
6077

6178
* | **Example 1:** Input Date: `29 December 2014` ; Format String: `YYYY-WW`
6279
| Output string: `2015-05` (Wrong because it’s not the 5th week of 2015)
6380
64-
* | **Example 2:** Input Date: `29 December 2014` ; Format String: `ww-YYYY (WW-MM-yyyy)`
81+
* | **Example 2:** Input Date: `29 December 2014` ;
82+
| Format String: `ww-YYYY (WW-MM-yyyy)`
6583
| Output string: `01-2015 (05-12-2014)` (This is correct)
6684
67-
#. YYYY + F : Week year with day of week in a calendar month (unless yyyy is also specified).
85+
#. YYYY + F : Week year with day of week in a calendar month
86+
(unless yyyy is also specified).
6887

69-
* | **Example 1:** Input Date: `29 December 2014` ; Format String: `YYYY-ww-F-EE`
70-
| Output string: `2015-01-5-Mon` (Wrong because it’s not the 5th Monday of January in 2015)
88+
* | **Example 1:** Input Date: `29 December 2014` ;
89+
| Format String: `YYYY-ww-F-EE`
90+
| Output string: `2015-01-5-Mon` (Wrong because it’s not the 5th Monday of
91+
| January in 2015)
7192
72-
* | **Example 2:** Input Date: `29 December 2014` ; Format String: `ww-YYYY (F-EE-MM-yyyy)`
93+
* | **Example 2:** Input Date: `29 December 2014` ;
94+
| Format String: `ww-YYYY (F-EE-MM-yyyy)`
7395
| Output string: `01-2015 (5-Mon-12-2014)` (This is correct)

clang-tools-extra/docs/clang-tidy/checks/objc/property-declaration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ The check will only fix 'CamelCase' to 'camelCase'. In some other cases we will
2323
only provide warning messages since the property name could be complicated.
2424
Users will need to come up with a proper name by their own.
2525

26-
This check also accepts special acronyms as prefixes or suffixes. Such prefixes or suffixes
27-
will suppress the Lower Camel Case check according to the guide:
26+
This check also accepts special acronyms as prefixes or suffixes. Such prefixes
27+
or suffixes will suppress the Lower Camel Case check according to the guide:
2828
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html#//apple_ref/doc/uid/20001281-1002931-BBCFHEAB
2929

3030
For a full list of well-known acronyms:

clang-tools-extra/docs/clang-tidy/checks/performance/no-int-to-ptr.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Diagnoses every integer to pointer cast.
77

88
While casting an (integral) pointer to an integer is obvious - you just get
99
the integral value of the pointer, casting an integer to an (integral) pointer
10-
is deceivingly different. While you will get a pointer with that integral value,
11-
if you got that integral value via a pointer-to-integer cast originally,
10+
is deceivingly different. While you will get a pointer with that integral
11+
value, if you got that integral value via a pointer-to-integer cast originally,
1212
the new pointer will lack the provenance information from the original pointer.
1313

1414
So while (integral) pointer to integer casts are effectively no-ops,

clang-tools-extra/docs/clang-tidy/checks/performance/noexcept-swap.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
performance-noexcept-swap
44
=========================
55

6-
The check flags user-defined swap and iter_swap functions not marked with ``noexcept`` or
7-
marked with ``noexcept(expr)`` where ``expr`` evaluates to ``false``
8-
(but is not a ``false`` literal itself).
6+
The check flags user-defined swap and iter_swap functions not marked with
7+
``noexcept`` or marked with ``noexcept(expr)`` where ``expr`` evaluates to
8+
``false`` (but is not a ``false`` literal itself).
99

10-
When a swap or iter_swap function is marked as ``noexcept``, it assures the compiler that
11-
no exceptions will be thrown during the swapping of two objects, which allows
12-
the compiler to perform certain optimizations such as omitting exception
13-
handling code.
10+
When a swap or iter_swap function is marked as ``noexcept``, it assures the
11+
compiler that no exceptions will be thrown during the swapping of two objects,
12+
which allows the compiler to perform certain optimizations such as omitting
13+
exception handling code.

clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-initialization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const reference.
99

1010
The check is only applied if it is safe to replace the copy by a const
1111
reference. This is the case when the variable is const qualified or when it is
12-
only used as a const, i.e. only const methods or operators are invoked on it, or
13-
it is used as const reference or value argument in constructors or function
12+
only used as a const, i.e. only const methods or operators are invoked on it,
13+
or it is used as const reference or value argument in constructors or function
1414
calls.
1515

1616
Example:

clang-tools-extra/docs/clang-tidy/checks/portability/simd-intrinsics.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ objects.
1919
Otherwise, it just complains the intrinsics are non-portable (and there are
2020
`P0214`_ alternatives).
2121

22-
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX,
23-
ARM NEON). It is common that SIMD code implementing the same algorithm, is
24-
written in multiple target-dispatching pieces to optimize for different
25-
architectures or micro-architectures.
22+
Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power
23+
AltiVec/VSX, ARM NEON). It is common that SIMD code implementing the same
24+
algorithm, is written in multiple target-dispatching pieces to optimize for
25+
different architectures or micro-architectures.
2626

2727
The C++ standard proposal `P0214`_ and its extensions cover many common SIMD
2828
operations. By migrating from target-dependent intrinsics to `P0214`_
29-
operations, the SIMD code can be simplified and pieces for different targets can
30-
be unified.
29+
operations, the SIMD code can be simplified and pieces for different targets
30+
can be unified.
3131

32-
Refer to `P0214`_ for introduction and motivation for the data-parallel standard
33-
library.
32+
Refer to `P0214`_ for introduction and motivation for the data-parallel
33+
standard library.
3434

3535
Options
3636
-------

clang-tools-extra/docs/clang-tidy/checks/portability/std-allocator-const.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ elements). These are not allowed in standard C++, and should usually be
99

1010
Per C++ ``[allocator.requirements.general]``: "T is any cv-unqualified object
1111
type", ``std::allocator<const T>`` is undefined. Many standard containers use
12-
``std::allocator`` by default and therefore their ``const T`` instantiations are
13-
undefined.
12+
``std::allocator`` by default and therefore their ``const T`` instantiations
13+
are undefined.
1414

15-
libc++ defines ``std::allocator<const T>`` as an extension which will be removed
16-
in the future.
15+
libc++ defines ``std::allocator<const T>`` as an extension which will be
16+
removed in the future.
1717

1818
libstdc++ and MSVC do not support ``std::allocator<const T>``:
1919

0 commit comments

Comments
 (0)