docs: Reorder code rules to fit better
This commit is contained in:
parent
15d308b7e5
commit
282deb4697
1 changed files with 1 additions and 1 deletions
|
|
@ -21,9 +21,9 @@ These are general guidelines for writing official bash modules and their documen
|
|||
- Use `snake_case` for functions and variables changed by the code.
|
||||
You can utilize `readonly (-f) snake_case` to mark variable or function as read-only when it won't be changed anymore.
|
||||
- Use `readonly SCREAMING_SNAKE_CASE` for variables that are set once and stay unchanged.
|
||||
- For functions that are set once and stay unchanged, make a function & in next line set: `readonly -f function_name`.
|
||||
- Use `"${variable_name}"` when you want to expose information from the variable & to ensure that variables are properly parsed as strings.
|
||||
- If you want to insert another regular string as a suffix or prefix to the `"${variable_name}"`, you should do that in this format: `"prefix-${variable_name}-suffix"`
|
||||
- For functions that are set once and stay unchanged, make a function & in next line set: `readonly -f function_name`
|
||||
- Use `set -euo pipefail` at the start of the script, to ensure that module will fail the image build if error is caught.
|
||||
- You can also use `set -euxo pipefail` during debugging, where each executed command is printed. This should not be used in a published module.
|
||||
- For downloading files, we utilize `curl`. Here's the template for what we're using:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue