-
Notifications
You must be signed in to change notification settings - Fork 16
Code styling
Please note that this document is a WIP. Once we have content of substance, it should be included in the main repo.
This document lays out the code styling requirements for code within TurnKey Linux.
Please note that current code in use that was written prior to this doc may not be compliant. Ideally we hope to make all of our code compliant, but that may take some time as we are not going to make this a high priority.
In the case of edits/additions to existing code, as a general rule try to make it compliant with these requirements, although consistency is important too. So if in doubt (and not willing/able to make the rest of the code compliant) making it consistent with existing code is a legitimate option.
Most of our code is either Python or Bash (with small amounts of other languages). So our main focus (at least initially) will be on Python code style, with an aim to also cover Bash (and perhaps shell?).
Unless otherwise noted here, code should be PEP8 (see also pep8.org) compliant. There are number of tools that can assist with that. flake8
& pycodestyle
are 2 options (and there are more).
All classes & functions should at the very least have a basic docstring. Ideally, the docstring should be inline with Google's python style guide on functions and methods.