Skip to content

Coding Guidelines

Sirin Puenggun edited this page Nov 2, 2023 · 4 revisions

Introdution

These Guidelines below are coding style guidelines for contributors to this project.

Python Style Rules

General Rule

  1. Indentation: Use tabs, 1 tap is 4 spaces

  2. String Quote: Can use any quote type (", ') but need to use the same quote in every place in the same function or scope.

  3. Line Length: Maximum line length is 100 characters.

  • Url Comment: No need to separate URL If it exceeds 100 lines.
  • Longer is better: If It's easier to understand with longer lines, then, keep it long.

Naming and Docstring Convention

Naming

Type Public Internal
Packages lower_with_under  
Modules lower_with_under _lower_with_under
Classes CapWords _CapWords
Exceptions CapWords  
Functions lower_with_under() _lower_with_under()
Global/Class Constants CAPS_WITH_UNDER _CAPS_WITH_UNDER
Global/Class Variables lower_with_under _lower_with_under
Instance Variables lower_with_under _lower_with_under (protected)
Method Names lower_with_under() _lower_with_under() (protected)
Function/Method Parameters lower_with_under  
Local Variables lower_with_under

Docstring

We will use reStructuredText (reST) format

"""
This is a reST style.

:param param1: this is a first param
:param param2: this is a second param
:returns: this is a description of what is returned
:raises keyError: raises an exception
"""

Clone this wiki locally