-
-
Notifications
You must be signed in to change notification settings - Fork 564
Coding Standards
CanbiZ edited this page Dec 6, 2024
·
1 revision
We maintain a set of coding standards to ensure consistency and readability across the scripts in this repository.
-
Indentation: Use 2 spaces for indentation (no tabs).
-
Variable Naming: Use uppercase for global variables and snake_case for local variables.
-
Quoting Variables: Always quote variables to prevent issues with spaces or special characters:
echo "$MY_VARIABLE"
-
Functions: Define functions using the following format:
my_function() { # function code }
-
Error Handling: Always include error handling:
catch_errors
-
Comments: Use comments to explain the purpose of complex code:
# This section installs the required dependencies
-
No Hardcoding: Avoid hardcoding values like usernames or paths. Use variables and configuration files instead.