From 3656e87b6b94161685148d59cbba801b290dc4d8 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 8 Oct 2020 12:53:13 -0400 Subject: [PATCH] doc: document use of black for python formatting Also moves "Exceptions" for C code under the C subsection. Signed-off-by: Quentin Young --- doc/developer/workflow.rst | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index f345464a35..4183ac6480 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -779,13 +779,12 @@ necessary replacements. .. _style-exceptions: Exceptions -^^^^^^^^^^ +"""""""""" FRR project code comes from a variety of sources, so there are some stylistic exceptions in place. They are organized here by branch. -For ``master`` -"""""""""""""" +For ``master``: BSD coding style applies to: @@ -797,8 +796,7 @@ BSD coding style applies to: - Indents are 4 spaces - Function return types are on their own line -For ``stable/3.0`` and ``stable/2.0`` -""""""""""""""""""""""""""""""""""""" +For ``stable/3.0`` and ``stable/2.0``: GNU coding style apply to the following parts: @@ -816,6 +814,21 @@ BSD coding style applies to: - ``ldpd/`` + +Python Code +^^^^^^^^^^^ + +Format all Python code with `black `_. + +In a line:: + + python3 -m black + +Run this on any Python files you modify before committing. + +FRR's Python code has been formatted with black version 19.10b. + + YANG ^^^^ -- 2.39.5