Skip to content

Commit 5edf70c

Browse files
authored
[clang-tidy][docs][NFC] Enforce 80 characters limit (1/N) (#167492)
Fix documentation in `abseil`, `android`, `altera`, `boost` and `bugprone`. This is part of the codebase cleanup described in [#167098](#167098)
1 parent 147e615 commit 5edf70c

File tree

63 files changed

+382
-336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+382
-336
lines changed

clang-tools-extra/docs/clang-tidy/checks/abseil/duration-addition.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
abseil-duration-addition
44
========================
55

6-
Check for cases where addition should be performed in the ``absl::Time`` domain.
7-
When adding two values, and one is known to be an ``absl::Time``, we can infer
8-
that the other should be interpreted as an ``absl::Duration`` of a similar
9-
scale, and make that inference explicit.
6+
Checks for cases where addition should be performed in the ``absl::Time``
7+
domain. When adding two values, and one is known to be an ``absl::Time``,
8+
we can infer that the other should be interpreted as an ``absl::Duration``
9+
of a similar scale, and make that inference explicit.
1010

1111
Examples:
1212

clang-tools-extra/docs/clang-tidy/checks/abseil/duration-division.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ abseil-duration-division
44
========================
55

66
``absl::Duration`` arithmetic works like it does with integers. That means that
7-
division of two ``absl::Duration`` objects returns an ``int64`` with any fractional
8-
component truncated toward 0. See `this link <https://github.com/abseil/abseil-cpp/blob/29ff6d4860070bf8fcbd39c8805d0c32d56628a3/absl/time/time.h#L137>`_ for more information on arithmetic with ``absl::Duration``.
7+
division of two ``absl::Duration`` objects returns an ``int64`` with any
8+
fractional component truncated toward 0.
9+
See `this link <https://github.com/abseil/abseil-cpp/blob/29ff6d4860070bf8fcbd39c8805d0c32d56628a3/absl/time/time.h#L137>`_
10+
for more information on arithmetic with ``absl::Duration``.
911

1012
For example:
1113

clang-tools-extra/docs/clang-tidy/checks/abseil/faster-strsplit-delimiter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ abseil-faster-strsplit-delimiter
55

66
Finds instances of ``absl::StrSplit()`` or ``absl::MaxSplits()`` where the
77
delimiter is a single character string literal and replaces with a character.
8-
The check will offer a suggestion to change the string literal into a character.
9-
It will also catch code using ``absl::ByAnyChar()`` for just a single character
10-
and will transform that into a single character as well.
8+
The check will offer a suggestion to change the string literal into a
9+
character. It will also catch code using ``absl::ByAnyChar()`` for just a
10+
single character and will transform that into a single character as well.
1111

1212
These changes will give the same result, but using characters rather than
1313
single character string literals is more efficient and readable.

clang-tools-extra/docs/clang-tidy/checks/abseil/string-find-str-contains.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
abseil-string-find-str-contains
44
===============================
55

6-
Finds ``s.find(...) == string::npos`` comparisons (for various string-like types)
7-
and suggests replacing with ``absl::StrContains()``.
6+
Finds ``s.find(...) == string::npos`` comparisons (for various string-like
7+
types) and suggests replacing with ``absl::StrContains()``.
88

99
This improves readability and reduces the likelihood of accidentally mixing
1010
``find()`` and ``npos`` from different string-like types.

clang-tools-extra/docs/clang-tidy/checks/abseil/upgrade-duration-conversions.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ argument needs an explicit cast to continue compiling after upcoming API
88
changes.
99

1010
The operators ``*=``, ``/=``, ``*``, and ``/`` for ``absl::Duration`` currently
11-
accept an argument of class type that is convertible to an arithmetic type. Such
12-
a call currently converts the value to an ``int64_t``, even in a case such as
13-
``std::atomic<float>`` that would result in lossy conversion.
11+
accept an argument of class type that is convertible to an arithmetic type.
12+
Such a call currently converts the value to an ``int64_t``, even in a case such
13+
as ``std::atomic<float>`` that would result in lossy conversion.
1414

1515
Additionally, the ``absl::Duration`` factory functions (``absl::Hours``,
1616
``absl::Minutes``, etc) currently accept an ``int64_t`` or a floating-point
1717
type. Similar to the arithmetic operators, calls with an argument of class type
1818
that is convertible to an arithmetic type go through the ``int64_t`` path.
1919

20-
These operators and factories will be changed to only accept arithmetic types to
21-
prevent unintended behavior. After these changes are released, passing an
20+
These operators and factories will be changed to only accept arithmetic types
21+
to prevent unintended behavior. After these changes are released, passing an
2222
argument of class type will no longer compile, even if the type is implicitly
2323
convertible to an arithmetic type.
2424

clang-tools-extra/docs/clang-tidy/checks/android/cloexec-inotify-init1.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
android-cloexec-inotify-init1
44
=============================
55

6-
``inotify_init1()`` should include ``IN_CLOEXEC`` in its type argument to avoid the
7-
file descriptor leakage. Without this flag, an opened sensitive file would
8-
remain open across a fork+exec to a lower-privileged SELinux domain.
6+
``inotify_init1()`` should include ``IN_CLOEXEC`` in its type argument
7+
to avoid the file descriptor leakage. Without this flag, an opened
8+
sensitive file would remain open across a fork+exec to a
9+
lower-privileged SELinux domain.
910

1011
Examples:
1112

clang-tools-extra/docs/clang-tidy/checks/android/cloexec-pipe.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
android-cloexec-pipe
44
====================
55

6-
This check detects usage of ``pipe()``. Using ``pipe()`` is not recommended, ``pipe2()`` is the
7-
suggested replacement. The check also adds the O_CLOEXEC flag that marks the file descriptor to
8-
be closed in child processes. Without this flag a sensitive file descriptor can be leaked to a
6+
This check detects usage of ``pipe()``. Using ``pipe()`` is not recommended,
7+
``pipe2()`` is the suggested replacement. The check also adds the ``O_CLOEXEC``
8+
flag that marks the file descriptor to be closed in child processes.
9+
Without this flag a sensitive file descriptor can be leaked to a
910
child process, potentially into a lower-privileged SELinux domain.
1011

1112
Examples:

clang-tools-extra/docs/clang-tidy/checks/android/cloexec-pipe2.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
android-cloexec-pipe2
44
=====================
55

6-
This check ensures that pipe2() is called with the O_CLOEXEC flag. The check also
7-
adds the O_CLOEXEC flag that marks the file descriptor to be closed in child processes.
6+
This check ensures that ``pipe2()`` is called with the ``O_CLOEXEC`` flag.
7+
The check also adds the ``O_CLOEXEC`` flag that marks the file descriptor
8+
to be closed in child processes.
89
Without this flag a sensitive file descriptor can be leaked to a child process,
910
potentially into a lower-privileged SELinux domain.
1011

clang-tools-extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Example buggy usage looks like:
2222
// Do something with cs.
2323
}
2424
25-
Because TEMP_FAILURE_RETRY will check for whether the result *of the comparison*
26-
is ``-1``, and retry if so.
25+
Because ``TEMP_FAILURE_RETRY`` will check for whether the result
26+
*of the comparison* is ``-1``, and retry if so.
2727

2828
If you encounter this, the fix is simple: lift the comparison out of the
2929
``TEMP_FAILURE_RETRY`` argument, like so:

clang-tools-extra/docs/clang-tidy/checks/boost/use-to-string.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
boost-use-to-string
44
===================
55

6-
This check finds conversion from integer type like ``int`` to ``std::string`` or
7-
``std::wstring`` using ``boost::lexical_cast``, and replace it with calls to
8-
``std::to_string`` and ``std::to_wstring``.
6+
This check finds conversion from integer type like ``int`` to
7+
``std::string`` or ``std::wstring`` using ``boost::lexical_cast``,
8+
and replace it with calls to ``std::to_string`` and ``std::to_wstring``.
99

1010
It doesn't replace conversion from floating points despite the ``to_string``
1111
overloads, because it would change the behavior.

0 commit comments

Comments
 (0)