Commit 76797235 authored by Keith Short's avatar Keith Short Committed by Anas Nashif
Browse files

docs: Make 100 column limit for code explicit



Zephyr's coding style is based on the Linux kernel coding style, which
indicates a preferred limit of 80 columns. Zephyr's .clang-format sets
the ColumnLimit to 100. Update the documentation to match the
.clang-format parameters.

Signed-off-by: default avatarKeith Short <keithshort@google.com>
parent f548a159
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -487,9 +487,7 @@ the first non-white space in the preceding line. For example::
      The text within a directive block should align with the
      first character of the directive name.

Keep the line length for documentation less than 80 characters to make
it easier for reviewing in GitHub. Long lines because of URL references
are an allowed exception.
Refer to the Zephyr :ref:`coding_style` for additional requirements.

zephyr-app-commands Directive
*****************************
+6 −2
Original line number Diff line number Diff line
@@ -444,9 +444,11 @@ project's style and naming conventions.
.. _Linux kernel coding style:
   https://kernel.org/doc/html/latest/process/coding-style.html

In general, follow the `Linux kernel coding style`_, with the
following exceptions:
In general, follow the `Linux kernel coding style`_, with the following
exceptions:

* The line length is 100 columns or fewer. In the documentation, longer lines
  for URL references are an allowed exception.
* Add braces to every ``if``, ``else``, ``do``, ``while``, ``for`` and
  ``switch`` body, even for single-line code blocks. Use the ``--ignore BRACES``
  flag to make *checkpatch* stop complaining.
@@ -455,6 +457,8 @@ following exceptions:
  comment, ``//``, is not allowed.
* Use ``/**  */`` for doxygen comments that need to appear in the documentation.

When there are differences between the guidelines above and the formatting
generated by code formatting tools, the guidelines above take precedence.

The Linux kernel GPL-licensed tool ``checkpatch`` is used to check
coding style conformity.