-
Notifications
You must be signed in to change notification settings - Fork 53
Coding Guidelines
This will outline the key pieces of how to code for Ainneve and make sure your code fits the formatting standards.
Some highlights of this:
- Tabs are 4 spaces, and they are SPACES, not TABS
- A blank line at the end of every file (no whitespace on this line)
- 75 characters per line maximum
There are some other pieces that are fairly nitpicky. If you are going to make serious code contributions, please read up in full: https://www.python.org/dev/peps/pep-0008/
Per allowed conventions by PEP8, we use lowercase and lower_case_with_underscore. All method names are lower_case_with_underscore and data in lists, dicts, etc are simply lowercase, as well as the variable names.
If data may be presented to the user as-is, please format it appropriately for reading.
Sublime Text 3 with Anaconda will automatically give you PEP8 errors as you code. You can follow this tutorial if using ST3: https://realpython.com/blog/python/setting-up-sublime-text-3-for-full-stack-python-development/
Here is my Sublime configuration:
{
"auto_complete": false,
"caret_style": "solid",
"color_scheme": "Packages/User/SublimeLinter/Flatland Dark (SL).tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
"*.pid",
"*.pyc"
],
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
".git",
"__pycache__",
"env",
"env3"
],
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
79
],
"scroll_past_end": false,
"show_full_path": true,
"show_minimap": false,
"sublimelinter": false,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"wide_caret": true,
"word_wrap": true,
"wrap_width": 80
}