-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Guidelines
These guidelines provide coding style recommendations for contributors to this project.
-
Indentation: Use tabs; one tab is equivalent to four spaces.
-
String Quote: You can use either double quotes (") or single quotes (') for strings, but be consistent within the same function or scope.
-
Line Length: Keep lines to a maximum of 100 characters.
- Url Comment: You don't need to break URLs into separate lines if they exceed 100 characters.
- Longer Line: If longer lines make the code more understandable, it's acceptable to keep them that way.
| 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 |
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
"""Use type hints as much as possible to enhance code usability.
Organize your imports in a specific order. Typically, it's recommended to group imports as follows:
- Standard Library imports
- Third-party library imports
- Django-related imports
- DRF-related imports
- Your project's custom imports
Wildcard Imports: Avoid using wildcard imports (e.g., from module import *)
Explicit Imports: Import only the specific classes or functions you need from a module rather than importing the entire module.
use from module import MyClass instead of import module.
We will only format *.js or *.jsx files with Prettier
You can navigate through this wiki with a sidebar on the right😉