Преглед изворни кода

doc: add information about astyle in codestyle

Signed-off-by: Huaqi Fang <578567190@qq.com>
Huaqi Fang пре 4 година
родитељ
комит
2ce2e648ef
1 измењених фајлова са 18 додато и 3 уклоњено
  1. 18 3
      doc/source/develop/codestyle.rst

+ 18 - 3
doc/source/develop/codestyle.rst

@@ -4,10 +4,24 @@ Code Style
 ==========
 
 In Nuclei SDK, we use `EditorConfig`_ to maintain our development
-coding styles.
+coding styles and `astyle`_ tool to format our source code.
+
+- Our `editorconfig file`_ is maintained in the root directory of
+  Nuclei SDK, called ``.editorconfig``.
+- Our astyle option file is maintained in the root directory of
+  Nuclei SDK, called ``.astylerc``.
+
+For example, if you want to format your applicaton code(*.c/*.h)
+located in ``application/baremetal/demo_timer``, you can run the
+following command:
+
+.. code-block:: shell
+
+    # make sure astyle is present in PATH
+    which astyle
+    # format code
+    astyle --options=.astylerc --recursive application/baremetal/demo_timer/*.c,*.h
 
-Our `editorconfig file`_ is maintained in the root directory of
-Nuclei SDK.
 
 You can install editorconfig plugins for your editor, see https://editorconfig.org/#download.
 
@@ -17,3 +31,4 @@ We use `doxygen`_ to comment C/C++ source code.
 .. _EditorConfig: https://editorconfig.org/
 .. _editorconfig file: https://github.com/Nuclei-Software/nuclei-sdk/tree/master/.editorconfig
 .. _doxygen: http://www.doxygen.nl/manual/docblocks.html
+.. _astyle: http://astyle.sourceforge.net/