If you wish to contribute to the SCAICT-uwu, feel free to fork the repository and submit a pull request.
All development happens on the development
branch. Make sure to submit pull
requests in the correct branch.
For TOML files, lines should be indented with 1 tab character per indenting level.
For JSON and Python files, lines should be indented with 4 whitespace characters per indenting level.
For YAML files, lines should be indented with 2 whitespace characters per indenting level.
- All files should use Unix-style newlines (single LF character, not a CR+LF combination).
- All files should have a newline at the end.
All text files must be encoded with UTF-8 without a Byte Order Mark.
Do not use Microsoft Notepad to edit files, as it always inserts a BOM.
The general whitespace style for Python would be:
statement # Inline comments
if condition and condition or condition:
if (
condition and
condition or
condition
):
def function_name(arg_1: type = "value 1", arg_2: type) -> type:
def function_name(
arg_1: type = "value 1",
arg_2: type
) -> type:
Developers should avoid adding trailing whitespace.
Lines should be broken with a line break at maximum 80 characters.
Imports should use the following order first, then the alphabetical order:
# Standard imports
# Third-party imports
# Local imports
See wrong-import-order / C0411 for further information.
Naming cases:
snake_case
camelCase
PascalCase
UPPER_CASE
Name Type | Case |
---|---|
module (file names) | snake_case |
const | UPPER_CASE |
class | PascalCase |
function | snake_case |
method | snake_case |
variable | snake_case |
attribute | snake_case |
argument | snake_case |
Example:
python_module.py
"""
Summary of module.
Extended description.
"""
# Standard imports
import standard_import
# Third-party imports
import third_party_import
# Local imports
import local_import
class ClassName:
"""
Summary of class.
Extended description.
Attributes:
CONST_NAME (int): Description of constant.
attr_name (int): Description of attribute.
"""
CONST_NAME = 1
"""
CONST_NAME (int): Description of constant.
"""
attr_name = 1
"""
attr_name (int): Description of attribute.
"""
def method_name(self, param_name: int) -> int:
"""
Summary of method.
Extended description.
Parameters:
param_name (int): Description of parameter.
Returns:
int: Description of return value.
Raises:
KeyError: Raises an exception.
"""
print(param_name)
return param_name
See invalid-name / C0103 for further information.
- ALWAYS and ONLY capitalize SQL reserved words in SQL queries.
- See the official documentations of SQL and the complete list on English Wikipedia as references.
- ALWAYS use
snake_case
for database, table, column, trigger names.- Table names and column names may NOT be case-sensitive in SQLite.
- Database, table, and trigger names may NOT be case-sensitive in MySQL/MariaDB.
- Column names should be unique, i.e., same column name should not exist in different tables.
- Column names should be prefixed with table names or abbrieviations.
- For example,
user_id
inuser
,ug_user
inuser_groups
.
- For example,
Examples:
INSERT INTO user (uid) VALUE (6856)
UPDATE game SET game_seq = game_seq + 1
- flask: https://flask.palletsprojects.com
- mysql-connector-python: https://dev.mysql.com/doc/connector-python/en/
- py-cord: https://docs.pycord.dev
- python-dotenv: https://saurabh-kumar.com/python-dotenv/
- requests: https://requests.readthedocs.io
- pylint: https://pylint.readthedocs.io
- pytest: https://docs.pytest.org