codestyle.rst 1.1 KB

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