[PATCH] coding-style: don't mention line length hard limits, add tips
From: Miguel Ojeda
Date: Thu Jun 11 2020 - 07:16:46 EST
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>
---
Documentation/process/coding-style.rst | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Documentation/process/coding-style.rst
b/Documentation/process/coding-style.rst
index 17a8e584f15f..309d3ae17e6c 100644
--- a/Documentation/process/coding-style.rst
+++ b/Documentation/process/coding-style.rst
@@ -84,11 +84,13 @@ Get a decent editor and don't leave whitespace at
the end of lines.
Coding style is all about readability and maintainability using commonly
available tools.
-The preferred limit on the length of a single line is 80 columns.
+Avoid lines that are too long and use reasonable line lengths. There is no
+hard limit: break lines where it makes the most sense, somewhere around
+the 80-120 columns. Complex statements should be broken into sensible chunks;
+identifiers should not be unreasonably verbose. Follow nearby conventions.
-Statements longer than 80 columns should be broken into sensible chunks,
-unless exceeding 80 columns significantly increases readability and does
-not hide information.
+A good test is using `clang-format`: if the formatter is unable to split
+the lines wisely, then the code likely needs rearrangement.
Descendants are always substantially shorter than the parent and are
are placed substantially to the right. A very commonly used style
--
2.27.0