From 84285e8958bfc168e4499d9c6c0e04f3d483a057 Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:06:51 +0200 Subject: [PATCH] docs: Revert using `readonly` from code guidelines Code looks less clean & is less readable, while gaining little to no benefit. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 31a3d5d..be13034 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,7 @@ These are general guidelines for writing official bash modules and their documen - Echo what you're doing on each step and on errors to help debugging. - Implement error-checks for scenarios where the image-maintainer might misconfigure the module. - Use `snake_case` for functions and variables changed by the code. -- 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 `SCREAMING_SNAKE_CASE` for variables that are set once and stay unchanged. - 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"` - Use `set -euo pipefail` at the start of the script, to ensure that module will fail the image build if error is caught.