forked from s_ranjbar/city_retrofit
22 lines
1.2 KiB
Markdown
22 lines
1.2 KiB
Markdown
# Cerc Python Style Guide
|
|
## What's coding style and why it matters
|
|
|
|
Coding style is just how the code looks, it's incredibly personal, and everyone has their style.
|
|
|
|
Your preferred architectures, variable and function naming style all of then impacts in your code style and how the others read and understand it, so it could become a significant burden if everyone is coding on his own.
|
|
|
|
At CERC we are following the [PEP8](https://www.python.org/dev/peps/pep-0008/) with two spaces indentation instead of four.
|
|
|
|
## Tools.
|
|
|
|
We use [PyCharm](https://www.jetbrains.com/pycharm/) as an integrated development environment and follow the tool's overall advice but the space indentation, which we set to two spaces instead of default four spaces.
|
|
|
|
For code analysis, we enforce the usage of [pylint](https://www.pylint.org/) with our own [custom style definition](pylintrc)
|
|
|
|
## Naming convention
|
|
|
|
* Name your folders and files in lowercase.
|
|
* Your class names must start in capital letters and follow the python CapWords pattern.
|
|
* Methods and properties that return lists must end in "s".
|
|
* Constants names must be all capitals.
|
|
* Avoid the usage of "get_" and "set_" methods whenever possible, by using @property and @variable.setter decorators instead. |