docs(agents): reorder variable naming guideline and clarify conditional syntax in bash style guide
- Reorder local variable naming rule in AGENTS.md for better flow - Add clarification note about escaping brackets when replacing `[ ]` with `[[ ]]` - Emphasize that `[]` acts as a regex filter in conditional expressions
This commit is contained in:
1 file changed
+2
-1
@@ -29,8 +29,8 @@ The following guideline is heavily based on the [Bash Style Guide | ysap.sh](htt
|
||||
|
||||
**Variables:** Distinct between local and environment vars.
|
||||
|
||||
- Use lowercase names for local variables (e.g., `buildx_output`).
|
||||
- Use `local` for all variables inside functions.
|
||||
- Use lowercase names for local variables (e.g., `buildx_output`).
|
||||
- Use uppercase names for environment variables (e.g. `BUILDX_PLATFORM`)
|
||||
|
||||
**Functions:**
|
||||
@@ -43,6 +43,7 @@ The following guideline is heavily based on the [Bash Style Guide | ysap.sh](htt
|
||||
|
||||
- Always use `[[ ... ]]` for conditional testing, not `[ ... ]` or `test`.
|
||||
- Use `((...))` for arithmetic comparisons (e.g., `((a > b))`).
|
||||
- When you replace `[]` with `[[]]` make sure to escape the brakets. The `[]` is a regex filter.
|
||||
|
||||
**Command Substitution:**
|
||||
|
||||
|
||||
Reference in new issue
Block a user