-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Zac edited this page Feb 21, 2017
·
2 revisions
Welcome to the ChefBoyRD wiki!
In this section we list the rules that all contributors should follow when writing code for the project.
As per python standard ALL python files must
- Use SPACES in place of tabs.
- The tab size should be 4 spaces
Docstrings should be included wherever necessary. In python a docstring is three single or triple quotes at the very top of a file or just below a method. Ex. take this file to be example.py
'''I am a short docstring description for the module
Extended description of the module in the same docstring
'''
def hello():
'''I am a method docstring
Longer description here
'''
return "hello"
Docstrings should be present for all modules and conform to the following format.
Module Docstring
'''short single sentence module description
Longer multi-sentence description (optional)
Extra discussion on how the module functions (optional)
Attributes:
module_level_var_1 (var_type): short sentence on what the variable is
'''
Method Docstring
def hello(arg1):
'''Short single sentence description
Longer multi-sentence description (optional)
Extra discussion on the workings of the function (optional)
(Required)
Args:
arg1 (arg1_type): Short description of arg1 variable
arg2 (type): etc...
(Required)
Returns:
(type): Description of return value
(Optional)
Throws:
(thrown error): Description of when it is thrown
'''
return 'hello'