mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Use consistent bash5 style for conditionals and quoting
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
# Style
|
||||
|
||||
- Two spaces for indentation, no tabs
|
||||
- Use bash 5 syntax: `[[ ]]` for conditionals, not `[ ]`. Don't quote variables inside `[[ ]]` (e.g., `[[ -n $var ]]` not `[[ -n "$var" ]]`)
|
||||
- Use bash 5 conditionals: use `[[ ]]` for string/file tests and `(( ))` for numeric tests
|
||||
- In `[[ ]]`, don't quote variables, but do quote string literals when comparing values (e.g., `[[ $branch == "dev" ]]`)
|
||||
- Prefer `(( ))` over numeric operators inside `[[ ]]` (e.g., `(( count < 50 ))`, not `[[ $count -lt 50 ]]`)
|
||||
- For strings/paths with spaces, quote them instead of escaping spaces with `\ ` (e.g., `"$APP_DIR/Disk Usage.desktop"`, not `$APP_DIR/Disk\ Usage.desktop`)
|
||||
- Shebangs must use `#!/bin/bash` consistently (never `#!/usr/bin/env bash`)
|
||||
|
||||
# Command Naming
|
||||
|
||||
|
||||
Reference in New Issue
Block a user