Kodi Community Forum
coding style guide - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: coding style guide (/showthread.php?tid=318364)



coding style guide - buhtz - 2017-07-17

Does there exist a coding style guide for Kodi AddOns?

e.g.
  • naming of variables
  • style of doc strings
  • ...



RE: coding style guide - Roman_V_M - 2017-07-17

Do you mean Python addons? There are no strict rules, but following general Python best practices is strongly recommended.

PEP-8 is the official coding style guide for Python.

As for docstrings, docstring with reStructuredText formatting and Sphinx directives are the de facto standard in Python world. PyCharm IDE can even use Sphinx directives for function/method parameters/returns as type hints for static code analysis (proper type hints have been added only in Python 3.5), highlighting potential issues with type mismatch.