coding style guide

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
buhtz Offline
Junior Member
Posts: 11
Joined: Jul 2017
Reputation: 0
Post: #1
Does there exist a coding style guide for Kodi AddOns?

e.g.
  • naming of variables
  • style of doc strings
  • ...
find quote
Roman_V_M Offline
Team-Kodi Member
Posts: 1,130
Joined: Jun 2011
Reputation: 55
Location: Kyiv, Ukraine
Post: #2
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.

Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
find quote